Patch - Re: [HACKERS] view vs. inheritance hierarchy - Mailing list pgsql-hackers

From Karel Zak - Zakkr
Subject Patch - Re: [HACKERS] view vs. inheritance hierarchy
Date
Msg-id Pine.LNX.3.96.991031151806.32618A-100000@ara.zf.jcu.cz
Whole thread Raw
In response to Re: [HACKERS] view vs. inheritance hierarchy (was: Bug(?) in pg_get_ruledef())  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Patch - Re: [HACKERS] view vs. inheritance hierarchy  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers



On Fri, 29 Oct 1999, Tom Lane wrote:

> Zakkr <zakkr@zf.jcu.cz> writes:
> > 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?
> 
> Sounds like a bug to me too.  The fix is probably just a small addition
> of code, but I haven't had time to look into it.
> 
>             regards, tom lane
Yes, I fix this bug. Here is my patch (for /src/backend/utils/adt/ruleutils) 
for it:

*** ruleutils.c.org    Mon Sep  6 00:55:28 1999
--- ruleutils.c    Sun Sep 31 13:37:42 1999
***************
*** 968,971 ****
--- 968,973 ----                 strcat(buf, "\"");                 strcat(buf, rte->relname);
+                 if (rte->inh)
+                     strcat(buf, "*");                 strcat(buf, "\"");                 if (strcmp(rte->relname,
rte->refname)!= 0)
 
***************
*** 973,976 ****
--- 975,980 ----                     strcat(buf, " \"");                     strcat(buf, rte->refname);
+                     if (rte->inh)
+                         strcat(buf, "*");                     strcat(buf, "\"");                 }

Add we (Jan or Tom) this code to PostgreSQL source main? (Pease).
                        Karel

------------------------------------------------------------------------------
Karel Zak <zakkr@zf.jcu.cz>                      http://home.zf.jcu.cz/~zakkr/

Kim Project:  http://home.zf.jcu.cz/~zakkr/kim/              (process manager)
FTP:          ftp://ftp2.zf.jcu.cz/users/zakkr/              (C/ncurses/PgSQL)
------------------------------------------------------------------------------



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Serial and NULL values
Next
From: Tom Lane
Date:
Subject: Re: Patch - Re: [HACKERS] view vs. inheritance hierarchy