Re: ERROR: syntax error at or near "IF"... why?

From: Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>
To: "DaNieL(dot)(dot)!" <daniele(dot)pignedoli(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ERROR: syntax error at or near "IF"... why?
Date: 2009-05-01 01:57:42
Message-ID: 3073cc9b0904301857r47edb6cbwc3dbe1c19d201556@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Apr 30, 2009 at 1:45 AM, DaNieL..! <daniele(dot)pignedoli(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2009-05-01 02:07:34 Re: Understand this error
Previous Message Steve Atkins 2009-05-01 01:43:03 Re: Mapping output from a SEQUENCE into something non-repeating/colliding but random-looking?