Re: Add column and specify the column position in a table

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Guillaume LELARGE <guillaume(dot)lelarge(at)gmail(dot)com>
Cc: emilu(at)encs(dot)concordia(dot)ca, pgsql-sql(at)postgresql(dot)org
Subject: Re: Add column and specify the column position in a table
Date: 2006-05-18 14:00:14
Message-ID: 20060518140014.GA3122@surnet.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Joe 2006-05-18 14:23:12 Re: MySQL DB to PostgresSQL DB
Previous Message Andreas Joseph Krogh 2006-05-18 13:41:53 Constraint question