Re: PL/pgSQL examples NOT involving functions

Поиск
Список
Период
Сортировка
Искать
От
Aasmund Midttun Godal
Тема
Re: PL/pgSQL examples NOT involving functions
Дата
Msg-id
20011115215049.14167.qmail@ns.krot.org
Ответ на
Список
Дерево обсуждения
PL/pgSQL examples NOT involving functions Roland Roberts <roland@astrofoto.org>
Re: PL/pgSQL examples NOT involving functions "Aasmund Midttun Godal" <postgresql@envisity.com>
Re: [DOCS] PL/pgSQL examples NOT involving functions "Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
Re: PL/pgSQL examples NOT involving functions Roland Roberts <roland@astrofoto.org>
Re: PL/pgSQL examples NOT involving functions "Aasmund Midttun Godal" <postgresql@envisity.com>
Re: PL/pgSQL examples NOT involving functions Roland Roberts <roland@astrofoto.org>
Re: PL/pgSQL examples NOT involving functions "Andrew G. Hammond" <drew@xyzzy.dhs.org>
Re: PL/pgSQL examples NOT involving functions "Aasmund Midttun Godal" <postgresql@envisity.com>
Re: PL/pgSQL examples NOT involving functions "Aasmund Midttun Godal" <postgresql@envisity.com>
Re: PL/pgSQL examples NOT involving functions "Josh Berkus" <josh@agliodbs.com>
Re: PL/pgSQL examples NOT involving functions "Aasmund Midttun Godal" <postgresql@envisity.com>
Re: PL/pgSQL examples NOT involving functions "Josh Berkus" <josh@agliodbs.com>
Re: PL/pgSQL examples NOT involving functions Stephan Szabo <sszabo@megazone23.bigpanda.com>
Re: PL/pgSQL examples NOT involving functions Jan Wieck <janwieck@yahoo.com>
Re: PL/pgSQL examples NOT involving functions "Aasmund Midttun Godal" <postgresql@envisity.com>
Re: PL/pgSQL examples NOT involving functions "Aasmund Midttun Godal" <postgresql@envisity.com>
Re: PL/pgSQL examples NOT involving functions Jan Wieck <janwieck@yahoo.com>
Re: PL/pgSQL examples NOT involving functions "Josh Berkus" <josh@agliodbs.com>
Re: PL/pgSQL examples NOT involving functions Roland Roberts <roland@astrofoto.org>
Cross-posting (was Re: PL/pgSQL examples NOT involving functions) Tom Lane <tgl@sss.pgh.pa.us>
Re: PL/pgSQL examples NOT involving functions "Josh Berkus" <josh@agliodbs.com>
Re: PL/pgSQL examples NOT involving functions Roland Roberts <roland@astrofoto.org>
Well, to the best of my knowledge your question is a contradiction in terms:

plpgsql is a procedural language to use it you must create a stored procedure or function...

However you are probably able to do many of the things you may want with plain old SQL look it up in the docs especially the case structure.

Regards,

Aasmund.
On 15 Nov 2001 11:49:12 -0500, Roland Roberts  wrote:
> How can I write a few lines of PL/pgSQL which do not involve creating
> a function?  I can find no examples of this in the docs, but say I
> would like to do something like
> 
>     BEGIN
>     IF EXISTS (SELECT * FROM foo WHERE idx = 27)
>     THEN
>         UPDATE foo SET var='some value' WHERE idx=27;
>     ELSE
>         INSERT INTO foo (idx, var) VALUES (27, 'some value');
>     END IF
>     END;
> 
> roland
> -- 
> 		       PGP Key ID: 66 BC 3B CD
> Roland B. Roberts, PhD                             RL Enterprises
> roland@rlenter.com                     76-15 113th Street, Apt 3B
> roland@astrofoto.org                       Forest Hills, NY 11375
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

Aasmund Midttun Godal

aasmund@godal.com - http://www.godal.com/
+47 40 45 20 46
В списке pgsql-sql по дате отправления
От: Tom Lane
Дата:
От: Josh Berkus
Дата:
FAQ