pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedLocation of a new column
4+ messages / 4 participants
[nested] [flat]
* Location of a new column
@ 2004-04-08 12:36 Terry Hampton <thampton@limacorp.com>
0 siblings, 1 reply; 4+ messages in thread
From: Terry Hampton @ 2004-04-08 12:36 UTC (permalink / raw)
To: pgsql-admin
All,
I thought this was answered before, but I
could not find anything in my saved email.
I need to ALTER a table to add a new column.
I want the new column to be between two existing
columns, however. Didn't I see mention of
an "AFTER" parameter that specified the location
in the table where the new column should be
placed ? Maybe not .......... How then,
can I specify the location within the table, of
new column ?
7.3 & RH Linux
Many thanks !
Terry
--
Terry L. Hampton
Project Manager
LimaCorp, LLC www.limacorp.com
513.587.1874
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Location of a new column
@ 2004-04-08 13:55 Stephan Szabo <sszabo@megazone.bigpanda.com>
parent: Terry Hampton <thampton@limacorp.com>
0 siblings, 1 reply; 4+ messages in thread
From: Stephan Szabo @ 2004-04-08 13:55 UTC (permalink / raw)
To: Terry Hampton <thampton@limacorp.com>; +Cc: pgsql-admin
On Thu, 8 Apr 2004, Terry Hampton wrote:
> I thought this was answered before, but I
> could not find anything in my saved email.
>
> I need to ALTER a table to add a new column.
> I want the new column to be between two existing
> columns, however. Didn't I see mention of
> an "AFTER" parameter that specified the location
> in the table where the new column should be
> placed ? Maybe not .......... How then,
> can I specify the location within the table, of
> new column ?
AFAIK, you can't using add column. It currently does no more than the
SQL92/99 spec requires in that respect (which is put the column at the
end).
About all you can do to put it somewhere else is a sequence with a new
table, copying data and renaming (and fixing constraints).
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Location of a new column
@ 2004-04-12 21:44 Robert Treat <xzilla@users.sourceforge.net>
parent: Stephan Szabo <sszabo@megazone.bigpanda.com>
0 siblings, 1 reply; 4+ messages in thread
From: Robert Treat @ 2004-04-12 21:44 UTC (permalink / raw)
To: Stephan Szabo <sszabo@megazone.bigpanda.com>; +Cc: Terry Hampton <thampton@limacorp.com>; pgsql-admin
On Thu, 2004-04-08 at 09:55, Stephan Szabo wrote:
>
> On Thu, 8 Apr 2004, Terry Hampton wrote:
>
> > I thought this was answered before, but I
> > could not find anything in my saved email.
> >
> > I need to ALTER a table to add a new column.
> > I want the new column to be between two existing
> > columns, however. Didn't I see mention of
> > an "AFTER" parameter that specified the location
> > in the table where the new column should be
> > placed ? Maybe not .......... How then,
> > can I specify the location within the table, of
> > new column ?
>
> AFAIK, you can't using add column. It currently does no more than the
> SQL92/99 spec requires in that respect (which is put the column at the
> end).
>
> About all you can do to put it somewhere else is a sequence with a new
> table, copying data and renaming (and fixing constraints).
>
IIRC this option is available in 7.5. At least I seem to remember some
(Chris K-L) posting a patch and it getting committed. You could check
the developers docs to verify I suppose.
Robert Treat
--
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Location of a new column
@ 2004-04-12 22:36 Tom Lane <tgl@sss.pgh.pa.us>
parent: Robert Treat <xzilla@users.sourceforge.net>
0 siblings, 0 replies; 4+ messages in thread
From: Tom Lane @ 2004-04-12 22:36 UTC (permalink / raw)
To: Robert Treat <xzilla@users.sourceforge.net>; +Cc: Stephan Szabo <sszabo@megazone.bigpanda.com>; Terry Hampton <thampton@limacorp.com>; pgsql-admin
Robert Treat <xzilla@users.sourceforge.net> writes:
> On Thu, 2004-04-08 at 09:55, Stephan Szabo wrote:
>> AFAIK, you can't using add column. It currently does no more than the
>> SQL92/99 spec requires in that respect (which is put the column at the
>> end).
> IIRC this option is available in 7.5.
No, there has been some discussion but no move to implement it.
AFAIR there is no reasonable way to implement it without breaking apps
that depend on the existing semantics of pg_attribute.attnum :-(.
Check the pghackers archives if you want to know more.
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2004-04-12 22:36 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-04-08 12:36 Location of a new column Terry Hampton <thampton@limacorp.com>
2004-04-08 13:55 ` Stephan Szabo <sszabo@megazone.bigpanda.com>
2004-04-12 21:44 ` Robert Treat <xzilla@users.sourceforge.net>
2004-04-12 22:36 ` Tom Lane <tgl@sss.pgh.pa.us>
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