Re: Changing Column Order (Was Re: MySQL vs PostgreSQL.) - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: Changing Column Order (Was Re: MySQL vs PostgreSQL.)
Date
Msg-id 200210120254.20255.list-pgsql-hackers@empires.org
Whole thread Raw
In response to Changing Column Order (Was Re: MySQL vs PostgreSQL.)  (Gavin Sherry <swm@linuxworld.com.au>)
Responses Re: Changing Column Order (Was Re: MySQL vs PostgreSQL.)  ("Shridhar Daithankar" <shridhar_daithankar@persistent.co.in>)
List pgsql-hackers
> >
> > Did attlognum's (for changing column order) get implemented for 7.2 ?
>
> I cannot think of any reason why changing column order should be
> implemented in Postgres. Seems like a waste of time/more code bloat for
> something which is strictly asthetic.
>
> Regardless, I do have collegues/clients who ask when such a feature will
> be implemented. Why is this useful?
>

I think even "asthetic" might go too far. It seems mostly irrelevent except 
for people who are obsessive compulsive and operate in interactive psql a 
lot. It's marginally simpler to get the columns ordered the way you want so 
that you can just do "SELECT * ..." rather than "SELECT att0,att1,... ..." at 
the interactive psql prompt, and still get the columns in your favorite 
order.

As far as I can tell, the order the attributes are returned makes no 
difference in a client application, unless you're referencing attributes by 
number. All applications that I've made or seen all use the name instead, and 
I've never heard otherwise, or heard any advantage to using numbers to 
reference columns. 

When someone asks, ask them "why?". I'd be interested to know if they have 
some other reason. I would think that if they absolutely wanted to fine-tune 
the order of columns they'd use a view (seems a little easier than 
continually changing order around by individual SQL statements). 

Regards,Jeff


pgsql-hackers by date:

Previous
From: Antti Haapala
Date:
Subject: Re: Changing Column Order (Was Re: MySQL vs PostgreSQL.)
Next
From: "Shridhar Daithankar"
Date:
Subject: Re: Changing Column Order (Was Re: MySQL vs PostgreSQL.)