Re: [HACKERS] Well, then you keep your darn columns

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: The Hermit Hacker <scrappy(at)hub(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] Well, then you keep your darn columns
Date: 2000-01-24 23:08:56
Message-ID: 3.0.5.32.20000125100856.0334bea0@mail.rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 15:44 24/01/00 -0400, The Hermit Hacker wrote:
>On Mon, 24 Jan 2000, Tom Lane wrote:
>
>> "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp> writes:
>> > My idea is as follows.
>>
>> > 1)add a visibile/invisible flag to pg_attribute
>> > 2)DROP COLUMN marks the column as invisible
>> > 3)user interface ignores the columns which are marked invisible
>> > 4)heap_formtuple() etc treats the column as NULL internally
>>
...etc..
>
>Oh, there is a second drawback to it though ...
>
>DROP COLUMN name
>ADD COLUMN name <of a different type>
>
>Then what? :(

Aren't there two separate issues to be resolved:

1. What happens with meta-data referential integrity - a problem for all
implementations.

2. How is it implemeneted.

For my 0.02c, the meta data integrity issue should be resolved by saying
'drop column' is not allowed if there is any (non-system-generated)
metadata that refers to it. Most people (I think) drop columns because they
have no use for them any longer. If they have indexes, constraints,
triggers etc based on those columns, then the drop should fail, since these
items are a prima-facie case that there is a use for them. Cascading
deletes are a nice thing, but for meta-data they can be quite dangerous.

As far as the implementation is concerned, I like the idea of 'hiding' the
deleted column, but am curious: can it be hidden more effectively so that
the only thing that ever sees it is the part of the code that reads it from
disk?

----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.C.N. 008 659 498) | /(@) ______---_
Tel: +61-03-5367 7422 | _________ \
Fax: +61-03-5367 7430 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2000-01-24 23:09:31 Re: [HACKERS] Well, then you keep your darn columns
Previous Message Hannu Krosing 2000-01-24 23:02:41 Re: [HACKERS] Well, then you keep your darn columns