Re: Reordering columns, will this ever be simple?

From: "Peter Childs" <peterachilds(at)gmail(dot)com>
To: novnov <novnovice(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Reordering columns, will this ever be simple?
Date: 2007-08-13 22:11:06
Message-ID: a2de01dd0708131511u571161b5g53fe5c0130cfe9b1@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 13/08/07, novnov <novnovice(at)gmail(dot)com> wrote:
>
>
> I would like to make a request for this feature to be added to postgres.
>
> Postgres is a really great database. I'm still very much a novice at using
> postgres but in general, it's been a very good experience and I plan to
> use
> it as often as I can. The community is very helpful.
>
> My projects tend to be more seat of the pants than your average enterprise
> database. Adding the ability to reorder columns in a simple manner would
> be
> a very nice addition. I think such a feature would add to the 'curb
> appeal'
> of postgres...make it more user friendly, more flexible.
>
> I don't know anything about the internals of databases, how they actually
> work, but from my 'ignorance is bliss' perspective, it seems odd that one
> can alter field names at will in postgres but reordering columns is such a
> big deal. Maybe internally columns are id'd via index position, thus order
> matters, and the name is relatively light duty property? Maybe too hard to
> explain it in simple terms.

Yes thats it or nearer enough, It was not until quite recently that you
could even drop a column.

Even now dropping a column is not a very good idea, It leaves the column
around inside the database marked as deleted data still intact (if I
remember correctly) So you can even get the data back by hmm messing with
the database internals (not a very good idea I believe an update on
pg_attribute will do the trick:)). Hence if you do more than drop the odd
column here or there you may be better dumping and reloading anyway!
Further more if you then add another column the already dropped column does
not get recycled.

I also remember some 7.2 drivers not coping correctly with 7.3 due to
dropped columns. Don't quote me on that I just remember having some problems
about 3 years ago with Qt!

Hmm this is beginning to sound like a leak.

Peter Childs

Decibel! wrote:
> >
> > On Tue, Aug 07, 2007 at 02:28:20PM -0500, Tony Caduto wrote:
> >> Gregory Stark wrote:
> >> >"novnov" <novnovice(at)gmail(dot)com> writes:
> >> >
> >> >
> >> >>Is there any plan to add such a capability to postgres?
> >> >>
> >> >
> >> >It's been talked about. I wouldn't be surprised to see it in 8.4 but
> >> >nobody's
> >> >said they'll be doing it yet and there are a lot of other more
> exciting
> >> >ideas
> >> >too.
> >> >
> >> >
> >> From a admin tool developers perspective the ability to reorder columns
> >> without manually copying to a new table and all that is pretty exiting
> >> :-)
> >
> > Patches welcome. :)
> >
> > BTW, this is much more likely to happen if we divorce presentation order
> > from actual storage order, something that there is some desire to do
> > because it would allow the engine to automagically store things in the
> > optimal ordering from an alignment standpoint.
> > --
> > Decibel!, aka Jim Nasby decibel(at)decibel(dot)org
> > EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Reordering-columns%2C-will-this-ever-be-simple--tf4231761.html#a12129772
> Sent from the PostgreSQL - general mailing list archive at Nabble.com.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ralph Smith 2007-08-13 23:25:19 Index not being used
Previous Message jf 2007-08-13 19:48:02 Re: UDFs