Re: ADD/DROP INHERITS

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: Hannu Krosing <hannu(at)skype(dot)net>, Zeugswetter Andreas DCP SD <ZeugswetterA(at)spardat(dot)at>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: ADD/DROP INHERITS
Date: 2006-06-08 16:27:55
Message-ID: 20060608162754.GQ45331@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jun 08, 2006 at 12:19:49PM -0400, Greg Stark wrote:
>
> "Jim C. Nasby" <jnasby(at)pervasive(dot)com> writes:
>
> > On Thu, Jun 08, 2006 at 11:42:49AM -0400, Greg Stark wrote:
> > > But I seem to recall some headaches with that approach.
> >
> > What happens if you
> >
> > ALTER TABLE ... ADD new_column int DEFAULT 1;
> > ALTER TABLE ... ALTER new_column SET DEFAULT 2;
>
> Ah yes. Keeping track of multiple old defaults and when they were in effect
> would indeed be quite a headache.

Probably. One possibility would be to track the table definition on an
XID basis and compare that info to the XMIN of a given row; that would
allow you to know exactly what the state of the table columns was. But
there's still a lot of pitfalls with that, such as VACUUM FREEZE. Since
ALTER TABLE on a very large table can be such a nightmare maybe some day
this will happen, but I'm not holding my breath.
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim C. Nasby 2006-06-08 16:30:15 Re: How to avoid transaction ID wrap
Previous Message Teodor Sigaev 2006-06-08 16:25:27 Re: Snowball and ispell in tsearch2