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> |
Subject: | Re: INSERT and UPDATE of ALLBALLS/INFINITY dates and |
Date: | 2003-11-06 15:41:40 |
Message-ID: | Pine.LNX.4.33.0311060840420.12086-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:
> Il gio, 2003-11-06 alle 16:00, scott.marlowe ha scritto:
> > > 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).
>
> Good idea! But you'll lose CONSTRAINTs and DEFAULTs. Isn't it?
Correct. Also any views based on the underlying table will no longer
work.
Then again, the order of fields in a table is pretty esoteric, so I'd
expect this to be a one time thing. Me personally, I just live with them
in the order they were created in mostly.
From | Date | Subject | |
---|---|---|---|
Next Message | Shridhar Daithankar | 2003-11-06 15:44:28 | Re: Fixed column format data |
Previous Message | btober | 2003-11-06 15:33:16 | Re: Sequences without blank holes |