Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] Open 6.4 items

From: jwieck(at)debis(dot)com (Jan Wieck)
To: maillist(at)candle(dot)pha(dot)pa(dot)us (Bruce Momjian)
Cc: jwieck(at)debis(dot)com, hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Open 6.4 items
Date: 1998-10-02 19:05:55
Message-ID: m0zPAWZ-000EBQC@orion.SAPserv.Hamburg.dsh.de (view raw or flat)
Thread:
Lists: pgsql-hackers
> > > SELECT * FROM pg_rules WHERE pg_rules.oid = pg_class.oid crashes
> > 
> >     Will take a look at it.
> > 

    Please apply the patch at the end. Disables use of system
    columns of views at all (not only oid, cmin etc. too).
    
    pgsql=> select cmin from pg_rules;
    ERROR:  system column cmin not available - pg_rules is a view
    pgsql=> select * from pg_rules where pg_rules.oid = pg_class.oid;
    ERROR:  system column oid not available - pg_rules is a view
    pgsql=> 

    initdb and regression tests still O.K.

> > > handle oid's on views by either disallowing it or meaningful results
> > > CREATE INDEX i_test ON pg_class (upper(relname)) fails

    Fixed by earlier applied patch.


Jan

-- 

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

diff -cr src.orig/backend/rewrite/rewriteHandler.c src/backend/rewrite/rewriteHandler.c
*** src.orig/backend/rewrite/rewriteHandler.c	Fri Oct  2 19:32:27 1998
--- src/backend/rewrite/rewriteHandler.c	Fri Oct  2 19:43:15 1998
***************
*** 1777,1782 ****
--- 1777,1784 ----
  						var->varno == rt_index) {
  					Node		*exp;
  
+ 					if (var->varattno < 0)
+ 						elog(ERROR, "system column %s not available - %s is a view", get_attname(rte->relid, var->varattno), rte->relname);
  					exp = FindMatchingTLEntry(
  							tlist,
  							get_attname(rte->relid,

In response to

Responses

pgsql-hackers by date

Next:From: Terry MackintoshDate: 1998-10-02 20:00:39
Subject: Bug, index problem??
Previous:From: Bruce MomjianDate: 1998-10-02 18:31:53
Subject: documentation changes

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group