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

From Robert Forsman
Subject Re: SQL( "if ...exists...),how to do it in the PostgreSQL?
Date
Msg-id 200106062232.SAA11021@nile.purplefrog.com
Whole thread Raw
In response to SQL( "if ...exists...),how to do it in the PostgreSQL?  ("Eric" <e-lz@263.net>)
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);
> /*********/

I don't know if this is SQL92, but 

insert into test(id) select 280 where not exists(select id from test);


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: [PATCHES] Fw: Isn't pg_statistic a security hole - Solution Proposal
Next
From: Robert Forsman
Date:
Subject: Re: Daily Digest V1 #1428