Skip site navigation (1) Skip section navigation (2)

Bug in pg_get_ruledef?

From: Sergio Pili <sergiop(at)sinectis(dot)com(dot)ar>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Laura Celia Rivero <lrivero(at)exa(dot)unicen(dot)edu(dot)ar>, Jorge Doorn <jdoorn(at)exa(dot)unicen(dot)edu(dot)ar>
Subject: Bug in pg_get_ruledef?
Date: 2001-11-25 22:24:16
Message-ID: 3C016F90.AA8824ED@sinectis.com.ar (view raw or flat)
Thread:
Lists: pgsql-hackers
Hello,

pg_get_ruledef cannot read the following rule:

test=# select version();
                               version
---------------------------------------------------------------------
 PostgreSQL 7.2b3 on i686-pc-linux-gnu, compiled by GCC egcs-2.91.66
(1 row)


With the following tables:

test=# \d rd
          Table "rd"
 Column |   Type   | Modifiers
--------+----------+-----------
 a      | smallint |
 b      | smallint |
 c      | text     |

            Table "ri"
 Column |   Type   |  Modifiers
--------+----------+--------------
 d      | smallint |
 e      | text     |
 a      | smallint | default 1000
 b      | smallint | default 2000


I create the following rule:

CREATE RULE ins_rd
AS ON INSERT TO ri
WHERE NEW.a IS NOT NULL 
	AND NEW.b IS NOT NULL
DO
        INSERT INTO rd (a,b)
        select distinct new.a,new.b


The rule works well. But when i select pg_rules:

test=# select * from pg_rules;
ERROR:  Invalid attnum 3 for rangetable entry *SELECT*


Thanks in advance

Sergio.

Responses

pgsql-hackers by date

Next:From: Peter EisentrautDate: 2001-11-25 22:29:57
Subject: Re: Call for objections: deprecate postmaster -o switch?
Previous:From: Sergio PiliDate: 2001-11-25 22:21:44
Subject: Change in rule behavior?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group