pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
2 Aktions in a Rule
7+ messages / 5 participants
[nested] [flat]

* 2 Aktions in a Rule
@ 1999-10-05 08:43 Florian Makesch <F.Makesch@sbe-zeta.de>
  1999-10-05 10:31 ` RE: [SQL] 2 Aktions in a Rule Sergey Bondarenko <sbon@scelto.ts.kiev.ua>
  1999-10-05 14:34 ` Re: [SQL] 2 Aktions in a Rule Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 7+ messages in thread

From: Florian Makesch @ 1999-10-05 08:43 UTC (permalink / raw)
  To: pgsql-sql

Hello,
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?

regards
Florian




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* RE: [SQL] 2 Aktions in a Rule
  1999-10-05 08:43 2 Aktions in a Rule Florian Makesch <F.Makesch@sbe-zeta.de>
@ 1999-10-05 10:31 ` Sergey Bondarenko <sbon@scelto.ts.kiev.ua>
  1 sibling, 0 replies; 7+ messages in thread

From: Sergey Bondarenko @ 1999-10-05 10:31 UTC (permalink / raw)
  To: pgsql-sql

I have the same problem. Dox says that multiple actions are permitted
on a single rule. But it won't work. I do not know why.

On 05-Oct-99 Florian Makesch wrote:
> Hello,
> 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?
> 
> regards
> Florian
> 
> 
> ************

Sergey Bondarenko
Relcom-Ukraine system administrator




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: [SQL] 2 Aktions in a Rule
  1999-10-05 08:43 2 Aktions in a Rule Florian Makesch <F.Makesch@sbe-zeta.de>
@ 1999-10-05 14:34 ` Tom Lane <tgl@sss.pgh.pa.us>
  1999-10-06 06:38   ` Re: [SQL] 2 Aktions in a Rule Sergey Bondarenko <sbon@scelto.ts.kiev.ua>
  1 sibling, 1 reply; 7+ messages in thread

From: Tom Lane @ 1999-10-05 14:34 UTC (permalink / raw)
  To: F.Makesch@sbe-zeta.de; +Cc: pgsql-sql

Florian Makesch <F.Makesch@sbe-zeta.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.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: [SQL] 2 Aktions in a Rule
  1999-10-05 08:43 2 Aktions in a Rule Florian Makesch <F.Makesch@sbe-zeta.de>
  1999-10-05 14:34 ` Re: [SQL] 2 Aktions in a Rule Tom Lane <tgl@sss.pgh.pa.us>
@ 1999-10-06 06:38   ` Sergey Bondarenko <sbon@scelto.ts.kiev.ua>
  0 siblings, 0 replies; 7+ messages in thread

From: Sergey Bondarenko @ 1999-10-06 06:38 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-sql; F.Makesch@sbe-zeta.de

Yep. It works.

I had the problem with 6.5.1 version both on RedHat 5.1 and FreeBSD 3.2 boxes.
It runs just fine, when is built using bison-1.28 (available at ftp.gnu.org).

Thanks all.

On 05-Oct-99 Tom Lane wrote:
> Florian Makesch <F.Makesch@sbe-zeta.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.
> 
>                       regards, tom lane
> 
> ************

Sergey Bondarenko
Relcom-Ukraine system administrator




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: [SQL] 2 Aktions in a Rule
@ 1999-10-05 14:58 Thomas Mack <mack@ips.cs.tu-bs.de>
  0 siblings, 0 replies; 7+ messages in thread

From: Thomas Mack @ 1999-10-05 14:58 UTC (permalink / raw)
  To: pgsql-sql

>
>Florian Makesch <F.Makesch@sbe-zeta.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@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@infbsdb1 ~/ingres/ib/bin 386 > bison --version
GNU Bison version 1.25
mack@infbsdb1 ~/ingres/ib/bin 387 > yacc --version
yacc: Command not found.
mack@infbsdb1 ~/ingres/ib/bin 388 > 
---------------------------------------------------------------------------


Thomas Mack
TU Braunschweig, Abt. Informationssysteme



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: [SQL] 2 Aktions in a Rule
@ 1999-10-05 15:26 Florian Makesch <F.Makesch@sbe-zeta.de>
  1999-10-05 19:09 ` Re: [SQL] 2 Aktions in a Rule Howie <caffeine@toodarkpark.org>
  0 siblings, 1 reply; 7+ messages in thread

From: Florian Makesch @ 1999-10-05 15:26 UTC (permalink / raw)
  To: tgl@sss.pgh.pa.us; +Cc: pgsql-sql

> 
> 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.

It is a Debian System with bison 1.25-13 installed, I recompield, but no
change.

Regards Florian Makesch 



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: [SQL] 2 Aktions in a Rule
  1999-10-05 15:26 Re: [SQL] 2 Aktions in a Rule Florian Makesch <F.Makesch@sbe-zeta.de>
@ 1999-10-05 19:09 ` Howie <caffeine@toodarkpark.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Howie @ 1999-10-05 19:09 UTC (permalink / raw)
  To: Florian Makesch <F.Makesch@sbe-zeta.de>; +Cc: tgl@sss.pgh.pa.us; pgsql-sql

On Tue, 5 Oct 1999, Florian Makesch wrote:

> > 
> > 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.
> 
> It is a Debian System with bison 1.25-13 installed, I recompield, but no
> change.

looks like you could use refint's check_primary_key() and
check_foreign_key() functions for this.  refint handles the foreign key
constraints for postgres 6.5.x.  its in the contrib/spi/ dir.  im making
extensive use of it in all my dbs.

---
Howie <caffeine@toodarkpark.org>   URL: http://www.toodarkpark.org    
"Just think how much deeper the ocean would be if sponges didn't live there."




^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~1999-10-06 06:38 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-10-05 08:43 2 Aktions in a Rule Florian Makesch <F.Makesch@sbe-zeta.de>
1999-10-05 10:31 ` Sergey Bondarenko <sbon@scelto.ts.kiev.ua>
1999-10-05 14:34 ` Tom Lane <tgl@sss.pgh.pa.us>
1999-10-06 06:38   ` Sergey Bondarenko <sbon@scelto.ts.kiev.ua>
1999-10-05 14:58 Re: [SQL] 2 Aktions in a Rule Thomas Mack <mack@ips.cs.tu-bs.de>
1999-10-05 15:26 Re: [SQL] 2 Aktions in a Rule Florian Makesch <F.Makesch@sbe-zeta.de>
1999-10-05 19:09 ` Howie <caffeine@toodarkpark.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox