Re: SQL( "if ...exists...),how to do it in the PostgreSQL? - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: SQL( "if ...exists...),how to do it in the PostgreSQL?
Date
Msg-id Pine.LNX.4.30.0106061648090.757-100000@peter.localdomain
Whole thread Raw
In response to SQL( "if ...exists...),how to do it in the PostgreSQL?  ("Eric" <e-lz@263.net>)
Responses Re: SQL( "if ...exists...),how to do it in the PostgreSQL?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Eric writes:

>    I can realize this function in the SYBase,but How can i do it in the PostgreSQL?
>
> /****SQL***/
> if not exists(select id from test) insert into test(id) values (280);
> /*********/

Write a function in PL/pgSQL.

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter



pgsql-hackers by date:

Previous
From: Alessio Bragadini
Date:
Subject: Strange error, probably WAL-related
Next
From: Tom Lane
Date:
Subject: Re: vacuumdb -a -z hangs