Re: DROP COLUMN

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Rod Taylor <rbt(at)zort(dot)ca>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: DROP COLUMN
Date: 2002-07-15 17:17:45
Message-ID: 200207151717.g6FHHjV13705@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-07-15 17:41:35 Re: DROP COLUMN
Previous Message Tom Lane 2002-07-15 17:05:40 Re: COPY x FROM STDIN escape handlers