Re: logical column ordering - Mailing list pgsql-hackers

From David G Johnston
Subject Re: logical column ordering
Date
Msg-id 1425079065505-5839825.post@n5.nabble.com
Whole thread Raw
In response to Re: logical column ordering  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Responses Re: logical column ordering  (David G Johnston <david.g.johnston@gmail.com>)
List pgsql-hackers
Tomas Vondra-4 wrote
> But if we want to allow users to define this, I'd say let's make that
> part of CREATE TABLE, i.e. the order of columns defines logical order,
> and you use something like 'AFTER' to specify physical order.
> 
>     CREATE TABLE test (
>         a INT AFTER b,    -- attlognum = 1, attphysnum = 2
>         b INT             -- attlognum = 2, attphysnum = 1
>     );

Why not memorialize this as a storage parameter?

CREATE TABLE test (   a INT, b INT
)
WITH (layout = 'b, a')
;

A canonical form should be defined and then ALTER TABLE can either directly
update the current value or require the user to specify a new layout before
it will perform the alteration.

David J.




--
View this message in context: http://postgresql.nabble.com/logical-column-ordering-tp5829775p5839825.html
Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: logical column ordering
Next
From: Josh Berkus
Date:
Subject: Re: logical column ordering