By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,178 Members | 987 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,178 IT Pros & Developers. It's quick & easy.

ALTER Table

P: n/a
Hi,
is it possible to add a column to a table at a specific place ? Reading
the man pages i could not figure that out.

Thanks.
Alex

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Alex wrote:
is it possible to add a column to a table at a specific place ? Reading
the man pages i could not figure that out.


Why do you want to add it at specific location? What does it achieve?

Shridhar
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 12 '05 #2

P: n/a
Shridhar Daithankar wrote:
Alex wrote:
is it possible to add a column to a table at a specific place ?
Reading the man pages i could not figure that out.

Why do you want to add it at specific location? What does it achieve?


I miss the same feature too, this is my reason:
is just to keep clean your schema, I have in my revision control system
all tables with fields grouped for tipology:

CREATE TABLE a(

G1 as INTEGER,
...
Gn as INTEGER,
H1 as INTEGER,
...
Hm as INTEGER
);

when I add let me say Gn+1 in my RCS I have:

CREATE TABLE a(

G1 as INTEGER,
...
Gn as INTEGER,
Gn+1 as INTEGER,
H1 as INTEGER,
...
Hm as INTEGER
);

and will be nice to have in my fourther dumps
the same structure, just to do a DIFF betwen two schemas
without become crazy!
I hope I was clear enough.
Regards
Gaetano Mendola





---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 12 '05 #3

P: n/a
Gaetano Mendola wrote:
Shridhar Daithankar wrote:
Alex wrote:
is it possible to add a column to a table at a specific place ?
Reading the man pages i could not figure that out.


Why do you want to add it at specific location? What does it achieve?

I miss the same feature too, this is my reason:
is just to keep clean your schema, I have in my revision control system
all tables with fields grouped for tipology:

CREATE TABLE a(

G1 as INTEGER,
...
Gn as INTEGER,
H1 as INTEGER,
...
Hm as INTEGER
);

when I add let me say Gn+1 in my RCS I have:

CREATE TABLE a(

G1 as INTEGER,
...
Gn as INTEGER,
Gn+1 as INTEGER,
H1 as INTEGER,
...
Hm as INTEGER
);

and will be nice to have in my fourther dumps
the same structure, just to do a DIFF betwen two schemas
without become crazy!


Well, if you diff two schema dumps, you will find one line added to correct
scope i.e. {} block because it belongs to same table. And anyway there is big
difference between schema diffs and database diffs. Sure you can not produce an
SQL script which would bring two databases to same state.

Only thing that can be done is to manually reordering the schema since it gives
you pretty localised view of changes due to repository.

Also check http://www.varlena.com/varlena/GeneralBits/30.html. The last bit
summerises another discussion on this.

HTH

Shridhar
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 12 '05 #4

P: n/a
Shridhar Daithankar wrote:
Gaetano Mendola wrote:
Shridhar Daithankar wrote:
Alex wrote:

is it possible to add a column to a table at a specific place ?
Reading the man pages i could not figure that out.


Why do you want to add it at specific location? What does it achieve?


I miss the same feature too, this is my reason:
is just to keep clean your schema, I have in my revision control system
all tables with fields grouped for tipology:

CREATE TABLE a(

G1 as INTEGER,
...
Gn as INTEGER,
H1 as INTEGER,
...
Hm as INTEGER
);

when I add let me say Gn+1 in my RCS I have:

CREATE TABLE a(

G1 as INTEGER,
...
Gn as INTEGER,
Gn+1 as INTEGER,
H1 as INTEGER,
...
Hm as INTEGER
);

and will be nice to have in my fourther dumps
the same structure, just to do a DIFF betwen two schemas
without become crazy!

Well, if you diff two schema dumps, you will find one line added to
correct scope i.e. {} block because it belongs to same table. And anyway
there is big difference between schema diffs and database diffs. Sure
you can not produce an SQL script which would bring two databases to
same state.

Only thing that can be done is to manually reordering the schema since
it gives you pretty localised view of changes due to repository.

Also check http://www.varlena.com/varlena/GeneralBits/30.html. The last
bit summerises another discussion on this.


Yes but the missing feature is there.
Regards
Gaetano Mendola


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.