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)
------------------------------------------------------------------------------