Re: BUG #5573: How can i add field inbetween in the table while creating

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Vimi" <vimmipraj(at)gmail(dot)com>,<pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #5573: How can i add field inbetween in the table while creating
Date: 2010-07-27 13:46:09
Message-ID: 4C4E9CD10200002500033D50@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Vimi" <vimmipraj(at)gmail(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Valentine Gogichashvili 2010-07-27 15:02:45 BUG #5574: PANIC on hot-standby: heap_update_redo
Previous Message Joshua Tolley 2010-07-27 13:44:59 Re: BUG #5573: How can i add field inbetween in the table while creating