Re: DROP COLUMN - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: DROP COLUMN
Date
Msg-id 200207151717.g6FHHjV13705@candle.pha.pa.us
Whole thread Raw
In response to Re: DROP COLUMN  (Rod Taylor <rbt@zort.ca>)
Responses Re: DROP COLUMN  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Rod Taylor wrote:
> On Mon, 2002-07-15 at 11:30, Christopher Kings-Lynne wrote:
> > OK, more DROP COLUMN funny business:
> > 
> > Assuming that selects, updates and deletes all ignore the dropped column,
> > what happens with things like alter table statements?
> > 
> > You can still quite happily set the default for a dropped column, etc.
> > 
> > Will I have to add a dropped column check in everywhere that a command is
> > able to target a column.  ie. create index, cluster, alter table, etc,
> > etc.?  Or is there an easier way?
> 
> Each utility statement does some kind of a SearchSysCache() to determine
> the status of the column (whether it exists or not).
> 
> You may want to write a wrapper function in lsyscache.c that returns the
> status of the column (dropped or not).  Perhaps the att tuple could be
> fetched through this function (processed on the way out) -- though
> lsyscache routines tend to return simple items.

Excellent idea.  That's how temp tables worked, by bypassing the
syscache.  I wonder if you could just prevent dropped columns from being
returned by the syscache.  That may work just fine.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: COPY x FROM STDIN escape handlers
Next
From: Tom Lane
Date:
Subject: Re: DROP COLUMN