0

I have a existing table with some columns , my objective is to add a new column at the first position using postgres, how can i do this? Any suggestions will be helpful.

Togad
  • 1
  • 1
  • 6

1 Answers1

1

I think that this has already been (not) answered. Postgresql doesn't feel column order is significant.

How to alter position of postgres columns

"Alter column position" in the PostgreSQL Wiki says:

PostgreSQL currently defines column order based on the attnum column of the pg_attribute table. The only way to change column order is either by recreating the table, or by adding columns and rotating data until you reach the desired layout.

RedCabbage
  • 53
  • 5