Re: [SQL] 2 Aktions in a Rule

From: Thomas Mack <mack(at)ips(dot)cs(dot)tu-bs(dot)de>
To: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] 2 Aktions in a Rule
Date: 1999-10-05 14:58:09
Message-ID: 199910051458.QAA25194@infbsdb1.idb.cs.tu-bs.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

>
>Florian Makesch <F(dot)Makesch(at)sbe-zeta(dot)de> writes:
>> I hope someone can help me. I Want 2 Aktions executeed in a Rule like:
>> CREATE RULE auftraege_neu_delete AS ON delete
>> TO auftraege_neu DO
>> (DELETE FROM auftraege_neu_positionen
>> WHERE auftraege_neu_positionen.auftragsnr = OLD.auftragsnr;
>> DELETE FROM auftraege_neu_zubehoer
>> WHERE auftraege_neu_zubehoer.auftragsnr = OLD.auftragsnr;);
>> but I get a Parser Error:
>> ERROR: parser: parse error at or near ""
>> This is in PostgreSQL 6.5.2
>> Has anyone the correct syntax?
>
>There's nothing wrong with that syntax AFAICS. Furthermore, my copy
>of Postgres takes it just fine (both 6.5.2 and current sources).
>
>I suspect you compiled with a buggy version of yacc or bison. Postgres'
>grammar is large and complex enough that it tends to expose problems
>in vendor-supplied yaccs :-(. Try getting a recent GNU bison (let's
>see ... I have 1.25 installed here, it's probably not the latest)
>and rebuilding.
>
Maybe...:

---------------------------------------------------------------------------
mack(at)infbsdb1 ~/ingres/ib/bin 385 > psql ib
Welcome to the POSTGRESQL interactive sql monitor:
Please read the file COPYRIGHT for copyright terms of POSTGRESQL
[PostgreSQL 6.5.1 on sparc-sun-solaris2.6, compiled by gcc egcs-2.91.66]

type \? for help on slash commands
type \q to quit
type \g or terminate with semicolon to execute query
You are currently connected to the database: ib

ib=> create table auftraege_neu(auftragsnr int4);
CREATE
ib=> create table auftraege_neu_positionen(auftragsnr int4);
CREATE
ib=> create table auftraege_neu_zubehoer(auftragsnr int4);
CREATE
ib=> CREATE RULE auftraege_neu_delete AS ON delete
ib-> TO auftraege_neu DO
ib-> (DELETE FROM auftraege_neu_positionen
ib-> WHERE auftraege_neu_positionen.auftragsnr = OLD.auftragsnr;
ib-> DELETE FROM auftraege_neu_zubehoer
ib-> WHERE auftraege_neu_zubehoer.auftragsnr = OLD.auftragsnr;);
CREATE
ib=> \q
mack(at)infbsdb1 ~/ingres/ib/bin 386 > bison --version
GNU Bison version 1.25
mack(at)infbsdb1 ~/ingres/ib/bin 387 > yacc --version
yacc: Command not found.
mack(at)infbsdb1 ~/ingres/ib/bin 388 >
---------------------------------------------------------------------------

Thomas Mack
TU Braunschweig, Abt. Informationssysteme

Browse pgsql-sql by date

  From Date Subject
Next Message Florian Makesch 1999-10-05 15:26:55 Re: [SQL] 2 Aktions in a Rule
Previous Message Tom Lane 1999-10-05 14:34:47 Re: [SQL] 2 Aktions in a Rule