Re: logical column position - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: logical column position
Date
Msg-id 200311180140.hAI1eFD20021@candle.pha.pa.us
Whole thread Raw
In response to logical column position  (Neil Conway <neilc@samurai.com>)
List pgsql-hackers
Neil Conway wrote:
> I'd like to add a new column to pg_attribute that specifies the
> attribute's "logical position" within its relation. The idea here is
> to separate the logical order of the columns in a relation from the
> on-disk storage of the relation's tuples. This allows us to easily &
> quickly change column order, add an additional column before or after
> an existing column, etc.
> 
> At present, attnum basically does three things: identifies an column
> within a relation, indicates which columns are system columns, and
> defines the order of a relation's columns. I'd like to move this last
> functionality into a separate pg_attribute column named "attpos" (or
> "attlogicalpos"):
> 
>          - when the table is created, attnum == attpos. System columns
>            have attpos < 0, as with attnum. At no point will two
>            columns of the same relation have the same attpos.
> 
>          - when returning output to the client and no column ordering
>            is implied by the query (e.g. "SELECT * ..."), we sort the
>            columns in ascending attpos order.

Seems the only cases where attpos would be used would be SELECT *,
INSERT with no column list, and COPY --- seems like a nifty feature.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: logical column position
Next
From: Christopher Kings-Lynne
Date:
Subject: Re: Release cycle length