Skip site navigation (1) Skip section navigation (2)

Re: column ordering, was Re: [PATCHES] Enums patch

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Russell Smith <mr-russ(at)pws(dot)com(dot)au>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Stephen Frost <sfrost(at)snowman(dot)net>, Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>, pgsql-hackers(at)postgresql(dot)org, Martijn van Oosterhout <kleptog(at)svana(dot)org>, Gregory Stark <stark(at)enterprisedb(dot)com>
Subject: Re: column ordering, was Re: [PATCHES] Enums patch
Date: 2006-12-20 16:20:16
Message-ID: 200612201620.kBKGKGW17573@momjian.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Andrew Dunstan wrote:
> > Now, we are rewriting the table from scratch anyway, the on disk 
> > format is changing.  What is stopping us from switching the column 
> > order at the same time.  The only thing I can think is that the 
> > catalogs will need more work to update them.  It's a middle sized 
> > price to pay for being able to reorder the columns in the table.  One 
> > of the problems I have is wanting to add a column in the middle of the 
> > table, but FK constraints stop me dropping the table to do the 
> > reorder.  If ALTER TABLE would let me stick it in the middle and 
> > rewrite the table on disk, I wouldn't care.  It's likely that I would 
> > be rewriting the table anyway.  And by specifying AT POSITION, or 
> > BEFORE/AFTER you know for big tables it's going to take a while.
> >
> 
> This isn't really a compromise. Remember that this discussion started 
> with consideration of optimal record layout (minimising space use by 
> reducing or eliminating alignment padding). The above proposal really 
> does nothing for that.

I assume space waste will be mostly fixed when we have 0/1 byte headers
for varlena data types.

-- 
  Bruce Momjian   bruce(at)momjian(dot)us
  EnterpriseDB    http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2006-12-20 16:24:02
Subject: Re: column ordering, was Re: [PATCHES] Enums patch v2
Previous:From: Bruce MomjianDate: 2006-12-20 16:13:23
Subject: Re: Companies Contributing to Open Source

pgsql-patches by date

Next:From: Tom LaneDate: 2006-12-20 16:24:02
Subject: Re: column ordering, was Re: [PATCHES] Enums patch v2
Previous:From: Bruce MomjianDate: 2006-12-20 16:06:46
Subject: Re: [PATCHES] Load distributed checkpoint patch

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group