Re: RES: Add column and specify the column position in

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Emi Lu <emilu(at)encs(dot)concordia(dot)ca>
Cc: Pgsql-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: RES: Add column and specify the column position in
Date: 2006-05-17 22:12:06
Message-ID: 20060517221206.GH42612@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, May 17, 2006 at 05:48:52PM -0400, Emi Lu wrote:
> I think it is a very useful feature for postgresql to support it.
>
> If we have this feature supported, I do not have to recreate the table
> and resetup all foreign key constraints, views, triggers, etc that are
> based on the table.

Uh, why do you have to do that? Please don't tell me you're using SELECT
*...

In any case, there's extensive discussion about this in the -hackers
archives. IIRC, there is consensus that this would be nice to have but
no one has cared enough to actually make it happen. There are some
non-trivial issues since this would mean either completely re-writing
the table when you do an ALTER or you'd have to be able to divorce the
catalog representation of a table with the on-disk representation.
Though there are other advantages to doing the later, it's non-trivial.

> >-->I am trying to insert one column to a specific position in a table.
> >-->
> >-->In mysql, I can do:
> >-->. create table test(id varchar(3), name varchar(12));
> >-->. alter table test add column givename varchar(12) after id;
> >-->
> >-->I am looking for similar things in postgresql to add a new
> >-->column to the
> >-->correct position in a table.
> >
> >-->Could someone hint me please.
> >-->Thanks alot!
> >
> >
>
> >Ying Lu
> >
> >
> >
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

--
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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jim C. Nasby 2006-05-17 22:15:12 Re: ALTER SEQUENCE
Previous Message Jim C. Nasby 2006-05-17 22:05:03 Re: Contributing code