Re: Alter Column Position

Поиск
Список
Период
Сортировка
От Godshall Michael
Тема Re: Alter Column Position
Дата
Msg-id A596FA3368757645AF862C701495CA0002A5E357@hor1mspmx01.gmachs.com
обсуждение исходный текст
Ответ на Alter Column Position  ("Derrick Betts" <Derrick@grifflink.com>)
Список pgsql-novice

You can't change the position of a column in an existing table. 

You can do a Insert into (select new column order) into a revised_order_copy_of_table, drop original table, rename new table.

Maybe export the data into a text file and re-import file into new table etc.

-----Original Message-----
From: pgsql-novice-owner@postgresql.org
[mailto:pgsql-novice-owner@postgresql.org]On Behalf Of Derrick Betts
Sent: Tuesday, December 09, 2003 4:35 PM
To: pgsql-novice@postgresql.org
Subject: [NOVICE] Alter Column Position

I have a table with 10,000 rows.  We have an application that parses a *.csv
file and uploads the data to the database table.  The csv parser takes the
column numbers form the csv file and matches the column numbers to the field
positions in the DB table.

Now, I have to change the position of a column in the DB to match the csv
parser.  I have a column in position 28 that I need to move to position 7.

Anyone know how to do that?

Thanks,
Derrick

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

В списке pgsql-novice по дате отправления:

Предыдущее
От: "Derrick Betts"
Дата:
Сообщение: Alter Column Position
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: PostgreSQL Training