Re: [HACKERS] view vs. inheritance hierarchy (was: Bug(?) in pg_get_ruledef())

From: wieck(at)debis(dot)com (Jan Wieck)
To: zakkr(at)zf(dot)jcu(dot)cz (Zakkr)
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] view vs. inheritance hierarchy (was: Bug(?) in pg_get_ruledef())
Date: 1999-10-29 12:55:24
Message-ID: m11hBYy-0003kLC@orion.SAPserv.Hamburg.dsh.de
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?)

Surely a bug!

Unfortunately I'm too busy at the moment to tackle it down.
The location where the inheritance is ignored is

src/backend/utils/adt/ruleutils.c

or a similar name - you'll find that file - it's the source
where that damned pg_get_ruledef() is defined. If you can
loacate and fix the problem therein depends on how familiar
you are with interpreting querytrees. At some place the table
name is printed, but I don't know if it is possible to tell
from the data at hand if it is an inheritance. Maybe another
catalog lookup is required there.

Oh man, this little 'piece of magic' (as someone else called
it) was only intended to demonstrate that it is POSSIBLE AT
ALL to translate a querytree back into it's original SQL
statement. Why the hell did I assist in making use of it in
pg_dump?

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#========================================= wieck(at)debis(dot)com (Jan Wieck) #

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Karel Zak - Zakkr 1999-10-29 13:23:21 Re: [HACKERS] view vs. inheritance hierarchy (was: Bug(?) in pg_get_ruledef())
Previous Message SAKAIDA 1999-10-29 10:45:05 pgbash-1.2.1 released