Skip site navigation (1) Skip section navigation (2)

Re: Alter table

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: Guillaume Houssay <ghoussay(at)noos(dot)fr>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Alter table
Date: 2003-07-30 17:01:36
Message-ID: Pine.LNX.4.33.0307301100110.24999-100000@css120.ihs.com (view raw or flat)
Thread:
Lists: pgsql-general
On Wed, 30 Jul 2003, Guillaume Houssay wrote:

> I am looking for the SQL query to add a column in a table and having 
> the column at specific position in the table (not at the end of the 
> table).
> 
> Do you have any idea ?

I think that's a TODO item (i.e. it's not implemented yet.)

Currently you'd have to either pg_dump and rearrange your data, or 
recreate the table with a select into / insert from select type thing.

select field1, field2, field4, ''::text as newfield, field3 into newtable 
from oldtable;


In response to

  • Alter table at 2003-07-30 16:21:17 from Guillaume Houssay

pgsql-general by date

Next:From: Richard HuxtonDate: 2003-07-30 17:14:55
Subject: Re: Alter table
Previous:From: George WeaverDate: 2003-07-30 16:45:34
Subject: Re: [SQL] ALTER TABLE ... DROP CONSTRAINT

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group