Re: [PATCHES] Demo patch for DROP COLUMN

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] Demo patch for DROP COLUMN
Date: 2002-07-23 01:35:48
Message-ID: GNELIHDDFBOCMGBFGEFOEEEKCDAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

> Yup, we need to figure out a way of preventing that. I've been thinking
> about adding an attisinherited column to pg_attribute, to mark columns
> that came from a parent table. Such a column could not be renamed or
> dropped except in a command that's recursed from the parent. (But what
> about multiply-inherited columns?)

Many-to-many...

> But you *didn't* make sure it would never be a problem.

Wasn't I looping until I found a unique name?? Dropping a column would
never fail in this case? Adding a column might, but I don't think that's
_impossible_ to avoid.

> > Where would you propose doing these post hoc checks?
>
> Not sure yet. I'm just wondering whether you've found all the places
> that will need to be tweaked to not dump core on nulls in the eref
> lists...

Well have a squiz at the regression test I submitted and see if you can spot
anything. I've attached the latest version of the patch where I've changed
naming to be like you suggested and improved code. Haven't looked at fixing
dependencies yet. I've also fixed foreign keys and the copy command as well
as pg_dump. The only command left is CREATE CONSTRAINT TRIGGER which I have
to hunt down where the heck it actually is implemented.

Even if you decide to change how the commands detect dropped columns (which
I don't think there's terribly much point in doing), it is easy to see from
my patch all the places that need the change.

Chris

Attachment Content-Type Size
dropcolumn3.txt.gz application/x-gzip 15.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dean Grubb 2002-07-23 01:41:00 Access Two Databases
Previous Message Barry Lind 2002-07-22 22:47:56 Re: [PATCHES] prepareable statements

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2002-07-23 15:34:39 Re: [PATCHES] prepareable statements
Previous Message Greg Sabino Mullane 2002-07-23 00:54:37 psql tab-complete: schema support, quotes, etc.