[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-sql
Subject:    Re: [SQL] EXISTS
From:       Denis Woodbury <denis () woodmic ! net>
Date:       2008-10-14 14:03:56
Message-ID: BLU0-SMTP2556233E6F183278C27702CB310 () phx ! gbl
[Download RAW message or body]

Thanks to those who responded, I see PL/PgSQL is the way to go

Regards, denis woodbury



on 10/11/08 1:32 PM, [NAME] at [ADDRESS] wrote:

> Denis Woodbury <denis@woodmic.net> writes:
>> I would like to know if this this type of statement can be used in
>> Postgresql
> 
>> IF NOT EXISTS (SELECT 1 FROM Table WHERE col1 = 'mystring' )
>> BEGIN
>> ...
>> END
> 
> I suspect you are trying to type that directly into SQL.
> You need to be using plpgsql in order to use procedural
> logic (ie, if/then).
> 
> regards, tom lane



-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic