Re: INSERT and UPDATE of ALLBALLS/INFINITY dates and MOVE

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: Marco Lazzeri <marcomail(at)noze(dot)it>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, Marco Lazzeri <marco(at)noze(dot)it>
Subject: Re: INSERT and UPDATE of ALLBALLS/INFINITY dates and MOVE
Date: 2003-11-06 15:00:06
Message-ID: Pine.LNX.4.33.0311060758330.12004-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 6 Nov 2003, Marco Lazzeri wrote:

> I need, also, to move columns in tables (just like the MOVE BEFORE/MOVE
> AFTER MySQL commands). Can you help me?

I do it with select into:

begin;
select field3, field2, field4, field1 into newtable from oldtable;
drop oldtable;
alter table newtable rename to oldtable;
commit; (or rollback; if something goes wrong).

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Rawnsley 2003-11-06 15:21:32 New eRServer patch/fork release
Previous Message Tom Lane 2003-11-06 14:54:21 Re: Problems with PLPGSQL