view vs. inheritance hierarchy (was: Bug(?) in pg_get_ruledef())

From: Zakkr <zakkr(at)zf(dot)jcu(dot)cz>
To: pgsql-hackers <pgsql-hackers(at)postgreSQL(dot)org>
Subject: view vs. inheritance hierarchy (was: Bug(?) in pg_get_ruledef())
Date: 1999-10-29 09:23:54
Message-ID: Pine.LNX.3.96.991029105037.14899A-100000@ara.zf.jcu.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

my first question was without answer, I try it again:

IMHO is a problem with the routine pg_get_ruledef(), this routine is used in
any query in the pg_dump for view dumping. But the pg_get_ruledef() not discern
contrast between view rules defined as 'select * table' and rules defined as
'select * table*' (the query should be run over all classes in the
inheritance hierarchy).

Is it a bug or a limitation? (The pg_dump is unworkable for a views tables
runnig over the inheritance hierarchy?)

Problem example:
---------------
abil=> create table mother_tab (aaa int);
CREATE

abil=> create table son () inherits(mother_tab);
CREATE

abil=> create view v_mother as select * from mother_tab*;
CREATE

abil=> insert into son values (111);
INSERT 4946878 1

abil=> select * from v_mother;
aaa
---
111
(1 row)

abil=> SELECT pg_get_ruledef(pg_rewrite.rulename) FROM pg_rewrite WHERE
rulename ='_RETv_mother';

CREATE RULE "_RETv_mother" AS ON SELECT TO "v_mother" DO INSTEAD SELECT
"mother_tab"."aaa" FROM "mother_tab";
(1 row)
^^^^^^^^^^^^
but right is "mother_tab*"

---

Any comments? (Please)

Karel Z.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zeugswetter Andreas IZ5 1999-10-29 09:34:44 AW: [HACKERS] Bug#48582: psql spends hours computing results it a lready knows (fwd)
Previous Message Brian E Gallew 1999-10-29 04:51:51 Re: [HACKERS] Bug#48582: psql spends hours computing results it already knows (fwd)