Re: Simple Column reordering - Mailing list pgsql-hackers

From Zeugswetter Andreas ADI SD
Subject Re: Simple Column reordering
Date
Msg-id E1539E0ED7043848906A8FF995BDA57901CAF790@m0143.s-mxs.net
Whole thread Raw
In response to Re: Simple Column reordering  (Lukas Kahwe Smith <smith@pooteeweet.org>)
List pgsql-hackers
> > If this is standards-breaking as you say, I would withdraw
immediately.
> > I checked the SQL standard and could not see how this would do so.
The
> > standard states SELECT * would return columns in order; it doesn't
say

Imho the create table order is implied. What other order would they mean
with "in order" ?
> > what that order should be, nor does CREATE TABLE enforce the
ordering
> > to be the same as it has specified, AFAICS. Please correct me and I
> > will withdraw. Practical issues seem far stronger drivers than
> > standards issues here, which is why the parameter would default=off.
>
> I did not follow the entire thread. I just wanted to point
> out that IIRC MS SQL Server (and maybe also Sybase) do
> automatically optimize the internal order of how columns are
> stored to move fixed length (which also means non NULLable
> for these two servers) columns to the left.
> Maybe this will serve as a reference point (not necessarily
> for standards compliance of course).

If you state that, it is imho also important to note that this is not
externally visible. select * is not altered.
I think we can have this based on Phil's patch. Simon would probably be
willing to extend it to choose the best physical order during create
table time. And the first step would be done.

The next step could then be to "fix" drop column and add "add column
before"
eighter using a 3rd column or using the existing 2.

Andreas



pgsql-hackers by date:

Previous
From: "Guillaume Smet"
Date:
Subject: Re: Simple Column reordering
Next
From: "Simon Riggs"
Date:
Subject: Re: Simple Column reordering