Re: ERROR: syntax error at or near "IF"... why? - Mailing list pgsql-general

From Jaime Casanova
Subject Re: ERROR: syntax error at or near "IF"... why?
Date
Msg-id 3073cc9b0904301857r47edb6cbwc3dbe1c19d201556@mail.gmail.com
Whole thread Raw
In response to Re: ERROR: syntax error at or near "IF"... why?  ("DaNieL..!" <daniele.pignedoli@gmail.com>)
List pgsql-general
On Thu, Apr 30, 2009 at 1:45 AM, DaNieL..! <daniele.pignedoli@gmail.com> wrote:
>>
>> > IF (SELECT credit FROM users WHERE name = 'mary') < 0 THEN
>> >  ROLLBACK;
>> > END IF
>> > COMMIT;
>>
>> > i always get the error
>> > ERROR:  syntax error at or near "IF"
>>

if you're inside a server-side function then you cannot use COMMIT nor
ROLLBACK; if you aren't inside a server-side function then you cannot
use IF

--
Atentamente,
Jaime Casanova
Soporte y capacitación de PostgreSQL
Asesoría y desarrollo de sistemas
Guayaquil - Ecuador
Cel. +59387171157

pgsql-general by date:

Previous
From: Steve Atkins
Date:
Subject: Re: Mapping output from a SEQUENCE into something non-repeating/colliding but random-looking?
Next
From: Stefan Sturm
Date:
Subject: Export Data from one DB and Import into a new DB