From: | ghatpande(at)vsnl(dot)net |
---|---|
To: | Thomas Kellerer <spam_eater(at)gmx(dot)net> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Adding a New Column Specifically In a Table |
Date: | 2010-10-14 10:13:34 |
Message-ID: | e63bb9f4d457.4cb71e1e@vsnl.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Or create view with your desired order on this table.
Regards,
Vijay
----- Original Message -----
From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Date: Thursday, October 14, 2010 3:09 pm
Subject: Re: [GENERAL] Adding a New Column Specifically In a Table
To: pgsql-general(at)postgresql(dot)org
> Carlos Mennens, 13.10.2010 20:06:
> >> OK so I have read the docs and Google to try and find a way to
> add a
> >> new column to an existing table. My problem is I need this new
> column>> to be created 3rd rather than just dumping this new
> column to the end
> >> of my table. I can't find anywhere how I can insert my new
> column as
> >> the 3rd table column rather than the last (seventh). Does
> anyone know
> >> how I can accomplish this or if it's even possible. Seems like a
> >> common task but I checked the documentation and may have missed
> it in
> >> my reading.
> >>
> >>
> >> ALTER TABLE users ADD COLUMN employer VARCHAR(50) NOT NULL;
> >
> > Ah sadly I just found this after I pressed 'send' and realized
> > PostgreSQL doesn't support it...that sucks :(
>
> The position of a column in a table has no meaning whatsoever -
> just like rows have no "position" as well.
>
> If you want columns returned in a specific order, simply put them
> in the desired order in your SELECT statement.
>
> Thomas
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>
From | Date | Subject | |
---|---|---|---|
Next Message | Thom Brown | 2010-10-14 10:32:12 | Re: Adding a New Column Specifically In a Table |
Previous Message | Massa, Harald Armin | 2010-10-14 10:02:13 | Re: querying the version of libpq |