Re: ALTER COLUMN/logical column position

From: Hannu Krosing <hannu(at)tm(dot)ee>
To: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
Cc: pg(at)fastcrypt(dot)com, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Neil Conway <neilc(at)samurai(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ALTER COLUMN/logical column position
Date: 2003-11-20 13:04:17
Message-ID: 1069333457.2935.9.camel@fuji.krosing.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andreas Pflug kirjutas N, 20.11.2003 kell 11:40:
> Hannu Krosing wrote:
>
> >
> >attnum is used internally to retrieve the data
> >
> >
> >
> Oops...
>
> So if an additional column number is invented, it should not be a
> logical column number, but a physical storage number for internal data
> retrieval.

You are just shifting the interface problems to a place needing way more
changes in the backend. There will be some problems either way.

also, tools needing knowledge should start using information schema as
much as they can, making internal reshufflings less of a problem.

> This way, the "user interface" doesn't change, and all those
> "SELECT ... FROM pg_attribute ORDER BY attnum" continue delivering the
> expected result.

Depending on what you expect ;)

If you expect the above to give you all active columns as orderd as they
are stored, then it does not give you what you expect.

Btw, most of these concerns (and more) were already iterated when DROP
column was done causing gaps in attnum. There were a lot of doomsday
profecies, but in the end it went quite smoothly. The tools needing
internal knowledge about storage (meaning any tool doing select .. from
pg_...) have always needed some upgrades for new verions.

IMHO, The only behaviour visible to common user we should worry about is
SELECT * , and a special column for solving this is _the_ easiest way to
do it.

-------------
Hannu

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Cramer 2003-11-20 13:04:56 Re: ALTER COLUMN/logical column position
Previous Message Andrew Dunstan 2003-11-20 12:44:15 Re: 4 Clause license?