dbTalk Databases Forums  

[BUGS] BUG #1533: "*OLD*" relation not recognized in CREATE RULE

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #1533: "*OLD*" relation not recognized in CREATE RULE in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Henk van den Toorn
 
Posts: n/a

Default [BUGS] BUG #1533: "*OLD*" relation not recognized in CREATE RULE - 03-13-2005 , 08:06 PM







The following bug has been logged online:

Bug reference: 1533
Logged by: Henk van den Toorn
Email address: vdtoorn (AT) hotmail (DOT) com
PostgreSQL version: 7.4.3-7
Operating system: Freebsd 5.3
Description: "*OLD*" relation not recognized in CREATE RULE
Details:

When creating a rule:

CREATE RULE rulename AS ON UPDATE
table WHERE OLD.index = NEW.index
DO INSTEAD NOTHING;

Postgresql responds with

ERROR: relation "*OLD*" does not exist

All kind of variations on "*OLD*"
like:

old.index; OLD.index; "*OLD*".index

do not work, nor does changing the order of the elements in the WHERE
clause.

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #1533: "*OLD*" relation not recognized in CREATE RULE - 03-13-2005 , 11:56 PM






"Henk van den Toorn" <vdtoorn (AT) hotmail (DOT) com> writes:
Quote:
CREATE RULE rulename AS ON UPDATE
table WHERE OLD.index = NEW.index
DO INSTEAD NOTHING;

Postgresql responds with

ERROR: relation "*OLD*" does not exist
Hm, works for me:

regression=# create table tab1 (index serial primary key, data text);
NOTICE: CREATE TABLE will create implicit sequence "tab1_index_seq" for "serial" column "tab1.index"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "tab1_pkey" for table "tab1"
CREATE TABLE
regression=# create rule r as on update to tab1 where old.index = new.index do instead nothing;
CREATE RULE
regression=# select version();
version
---------------------------------------------------------------
PostgreSQL 7.4.7 on hppa-hp-hpux10.20, compiled by GCC 2.95.3
(1 row)

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.