Re: Add column and specify the column position in a table - Mailing list pgsql-sql

From Guillaume Lelarge
Subject Re: Add column and specify the column position in a table
Date
Msg-id d854adec0605180843y646f953cwb490a03f3c1d0602@mail.gmail.com
Whole thread Raw
In response to Re: Add column and specify the column position in a table  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: Add column and specify the column position in a table
List pgsql-sql
2006/5/18, Alvaro Herrera <alvherre@commandprompt.com>:
> Guillaume LELARGE wrote:
> > Emi Lu a écrit :
> > > 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.
> >
> > There's no similar thing in PostgreSQL. You have to duplicate the table
> > to do it.
>
> ... which is the same thing MySQL does, only you must do it explicitely.
>

Do you mean that, using "alter table test add column" with the "after"
option, MySQL creates a new table, populates it with the old table
data and finally drops the old table ? I mean, there's the same
performance problem with big tables ?


--
Guillaume.


pgsql-sql by date:

Previous
From: Joe
Date:
Subject: Re: MySQL DB to PostgresSQL DB
Next
From: Andrew Sullivan
Date:
Subject: Re: Add column and specify the column position in a table