Re: BUG #5573: How can i add field inbetween in the table while creating - Mailing list pgsql-bugs

From Kevin Grittner
Subject Re: BUG #5573: How can i add field inbetween in the table while creating
Date
Msg-id 4C4E9CD10200002500033D50@gw.wicourts.gov
Whole thread Raw
In response to BUG #5573: How can i add field inbetween in the table while creating  ("Vimi" <vimmipraj@gmail.com>)
List pgsql-bugs
"Vimi" <vimmipraj@gmail.com> wrote:

> How can i add field inbetween in the table while creating

This is not a bug; in the future please post such questions to
pgsql-general.

While the feature you're requesting is likely to appear in a future
release, current releases require that you create a new table with
the desired structure, copy data from the old table into it, drop or
rename the old table, and rename the new table into place.  You
would probably want to begin a transaction and acquire an exclusive
lock on the old table before starting this, and commit after the new
table is in its place.

On the other hand, in well-written software, the order of the
columns in the table should make no difference; you might just want
to avoid SELECT * and dodge the whole issue.

-Kevin

pgsql-bugs by date:

Previous
From: Joshua Tolley
Date:
Subject: Re: BUG #5573: How can i add field inbetween in the table while creating
Next
From: "Valentine Gogichashvili"
Date:
Subject: BUG #5574: PANIC on hot-standby: heap_update_redo