Re: logical column ordering - Mailing list pgsql-hackers

From Josh Berkus
Subject Re: logical column ordering
Date
Msg-id 54F0CF0D.2070409@agliodbs.com
Whole thread Raw
In response to Re: logical column ordering  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Responses Re: logical column ordering  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Re: logical column ordering  (Gavin Flower <GavinFlower@archidevsys.co.nz>)
List pgsql-hackers
Tomas,

So for an API, 100% of the use cases I have for this feature would be
satisfied by:

ALTER TABLE ______ ALTER COLUMN _____ SET ORDER #

and:

ALTER TABLE _____ ADD COLUMN colname coltype ORDER #

If that's infeasible, a function would be less optimal, but would work:

SELECT pg_column_order(schemaname, tablename, colname, attnum)

If you set the order # to one where a column already exists, other
column attnums would get "bumped down", closing up any gaps in the
process.  Obviously, this would require some kind of exclusive lock, but
then ALTER TABLE usually does, doesn't it?

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Providing catalog view to pg_hba.conf file - Patch submission
Next
From: Tomas Vondra
Date:
Subject: Re: logical column ordering