pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedAdding Column in Specific Position of table
4+ messages / 3 participants
[nested] [flat]
* Adding Column in Specific Position of table
@ 2015-04-29 09:43 Ankur Kaushik <ankurkaushik@gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Ankur Kaushik @ 2015-04-29 09:43 UTC (permalink / raw)
To: pgsql-admin
Hi ,
I can I alter table to add column at specific position ,
below
Table : Post
Column : a
b
d
Want to add new column c before d or after b.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Adding Column in Specific Position of table
@ 2015-04-29 09:51 Jan Lentfer <Jan.Lentfer@web.de>
parent: Ankur Kaushik <ankurkaushik@gmail.com>
0 siblings, 2 replies; 4+ messages in thread
From: Jan Lentfer @ 2015-04-29 09:51 UTC (permalink / raw)
To: Ankur Kaushik <ankurkaushik@gmail.com>; +Cc: pgsql-admin
Hi, this is not currently possibly with just an ALTER TABLE. Regards, Jan.
Von meinem iPad gesendet
> Am 29.04.2015 um 11:43 schrieb Ankur Kaushik <ankurkaushik@gmail.com>:
>
>
> Hi ,
>
> I can I alter table to add column at specific position ,
>
> below
>
> Table : Post
>
>
> Column : a
> b
> d
>
> Want to add new column c before d or after b.
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Adding Column in Specific Position of table
@ 2015-04-29 09:57 Jan Lentfer <Jan.Lentfer@web.de>
parent: Jan Lentfer <Jan.Lentfer@web.de>
1 sibling, 0 replies; 4+ messages in thread
From: Jan Lentfer @ 2015-04-29 09:57 UTC (permalink / raw)
To: Ankur Kaushik <ankurkaushik@gmail.com>; +Cc: pgsql-admin
None that I am aware of. But from my experience, order does not really matter.
Von meinem iPad gesendet
> Am 29.04.2015 um 11:53 schrieb Ankur Kaushik <ankurkaushik@gmail.com>:
>
>
> So Any Other way Apart from Recreating the table structure ?
>
>> On Wed, Apr 29, 2015 at 3:21 PM, Jan Lentfer <Jan.Lentfer@web.de> wrote:
>> Hi, this is not currently possibly with just an ALTER TABLE. Regards, Jan.
>>
>> Von meinem iPad gesendet
>>
>> > Am 29.04.2015 um 11:43 schrieb Ankur Kaushik <ankurkaushik@gmail.com>:
>> >
>> >
>> > Hi ,
>> >
>> > I can I alter table to add column at specific position ,
>> >
>> > below
>> >
>> > Table : Post
>> >
>> >
>> > Column : a
>> > b
>> > d
>> >
>> > Want to add new column c before d or after b.
>
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Adding Column in Specific Position of table
@ 2015-04-29 15:28 Craig James <cjames@emolecules.com>
parent: Jan Lentfer <Jan.Lentfer@web.de>
1 sibling, 0 replies; 4+ messages in thread
From: Craig James @ 2015-04-29 15:28 UTC (permalink / raw)
To: Jan Lentfer <Jan.Lentfer@web.de>; +Cc: Ankur Kaushik <ankurkaushik@gmail.com>; pgsql-admin
On Wed, Apr 29, 2015 at 2:51 AM, Jan Lentfer <Jan.Lentfer@web.de> wrote:
> Hi, this is not currently possibly with just an ALTER TABLE. Regards, Jan.
>
> Von meinem iPad gesendet
>
> > Am 29.04.2015 um 11:43 schrieb Ankur Kaushik <ankurkaushik@gmail.com>:
> >
> >
> > Hi ,
> >
> > I can I alter table to add column at specific position ,
> >
> > below
> >
> > Table : Post
> >
> >
> > Column : a
> > b
> > d
> >
> > Want to add new column c before d or after b.
>
It's probably a bad idea, too. If your application depends on the ordering
of the columns, I guarantee you'll regret it. It's a recipe for mysterious
bugs.
Every SQL query should name the columns. If you do that, the column
ordering doesn't matter.
Craig
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2015-04-29 15:28 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-04-29 09:43 Adding Column in Specific Position of table Ankur Kaushik <ankurkaushik@gmail.com>
2015-04-29 09:51 ` Jan Lentfer <Jan.Lentfer@web.de>
2015-04-29 09:57 ` Jan Lentfer <Jan.Lentfer@web.de>
2015-04-29 15:28 ` Craig James <cjames@emolecules.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox