Re: SQL( "if ...exists...),how to do it in the PostgreSQL?

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Eric <e-lz(at)263(dot)net>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SQL( "if ...exists...),how to do it in the PostgreSQL?
Date: 2001-06-06 14:48:34
Message-ID: Pine.LNX.4.30.0106061648090.757-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)gmx(dot)net http://funkturm.homeip.net/~peter

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-06-06 14:52:58 Re: vacuumdb -a -z hangs
Previous Message Peter Eisentraut 2001-06-06 14:45:46 Re: psql bug or feature?