EnterpriseDB: The Enterprise Postgres Company Postgres Plus Forums: The PostgreSQL Open Source Database from EnterpriseDB
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 

How to change the position of a column in a table  XML

Forum Index » PostgreSQL (formerly Standard Server)
Author Message
vas3255

New member

Joined: 27 Jan 2012 01:27:18
Messages: 7
Offline

Hi All,


after adding a column to a table by using alter command, if i want change the position of that newly added column what i need to do.


Thanks & Regards,
Srinivas Davuluri

This message was edited 1 time. Last update was at 23 Apr 2012 02:51:54

raghavendra_rao

Senior member
[Avatar]

Joined: 2 Sep 2009 06:28:39
Messages: 193
Offline

Please follow the below link.
http://wiki.postgresql.org/wiki/Alter_column_position

Best Regards
Raghavendra
EnterpriseDB Corporation
Blog: http://raghavt.blogspot.com/
vas3255

New member

Joined: 27 Jan 2012 01:27:18
Messages: 7
Offline

Thank U for your reply.

Well, i know that the way of changing column by recreating the table.
But is there any other solution for changing the position of a column.

Thanks & Regards,
Srinivas Davuluri
raghavendra_rao

Senior member
[Avatar]

Joined: 2 Sep 2009 06:28:39
Messages: 193
Offline

Well, another way is not recommended, i.e., changing the column position in system catalogs. Try moving column positioning by updating pg_attribute (attnum column) system catalog table.

Best Regards
Raghavendra
EnterpriseDB Corporation
Blog: http://raghavt.blogspot.com/
 
Forum Index » PostgreSQL (formerly Standard Server)
Go to:   
Powered by JForum 2.1.8 © JForum Team