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

Поиск
Список
Период
Сортировка
От Jim C. Nasby
Тема Re: RES: Add column and specify the column position in
Дата
Msg-id 20060517221206.GH42612@pervasive.com
обсуждение исходный текст
Ответ на Re: RES: Add column and specify the column position in  (Emi Lu <emilu@encs.concordia.ca>)
Ответы Re: RES: Add column and specify the column position in  (Emi Lu <emilu@encs.concordia.ca>)
Re: RES: Add column and specify the column position in  (Robert Treat <xzilla@users.sourceforge.net>)
Список 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@postgresql.org so that your
>       message can get through to the mailing list cleanly
>

--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

В списке pgsql-general по дате отправления:

Предыдущее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: Contributing code
Следующее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: ALTER SEQUENCE