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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-hackers by date

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