IF- statements in a rule's 'DO INSTEAD SELECT ...'- statement

From: "Bertin, Philippe" <philippe(dot)bertin(at)barco(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: Alvaro Herrera <alvherre(at)atentus(dot)com>
Subject: IF- statements in a rule's 'DO INSTEAD SELECT ...'- statement
Date: 2002-05-06 11:31:04
Message-ID: B9E404D03707D511BD4D00105A40C10466B56E@wevmex01.barco.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello, all,

Can I insert IF- statements into a rule's DO INSTEAD- clause ? I have the
problem in a situation like :

create rule vprinsert as on insert to vpr_status
do instead (DDDDD);

if I insert as DDDDD a genuine SELECT- statement (or, Alvaro, several select
statements), everything is OK; but if I start inserting IF- statements, it's
not OK any more (syntax errors). Don't I just know the exact syntax, or is
this simply impossible ?

Anyone any idea on how to resolve this ?

Regads,

Philippe Bertin.

P.S. To have an idea why I want to insert IF- statements into the rule,
please refer to my newsgroup posting of last Friday ...

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrzej Zeja 2002-05-06 13:39:05 Using B-Tree index for such kind of queries (with '>','<')
Previous Message Erwin Ambrosch 2002-05-06 09:51:55 Foreign Key Option