Re: Preserving column order when recreating table.

Поиск
Список
Период
Сортировка
От Andrew Sullivan
Тема Re: Preserving column order when recreating table.
Дата
Msg-id 20040915131930.GA28290@phlogiston.dyndns.org
обсуждение исходный текст
Ответ на Preserving column order when recreating table.  (Stef <svb@ucs.co.za>)
Ответы Re: Preserving column order when recreating table.
Список pgsql-sql
On Wed, Sep 15, 2004 at 02:24:45PM +0200, Stef wrote:

> I'm struggling with a situation where I 
> want to recreate a table (in more than 30 databases) to
> fix the column order (attnum sequence) and in another case,
> fix different definitions for the same column in a table e.g. 
> amount numeric(16,2) 
> in stead of :
> amount numeric(16,5)

I'm not sure why you want to do the former, but in any case, it's
possible by creating a new table which has things the way you want;
select all the old data from the old table into the new table (using
the column names to get everything in the order you like, of course),
and then rename the old table, rename the new table to the old table
name, and drop the old table if you like.

A 

-- 
Andrew Sullivan  | ajs@crankycanuck.ca
The fact that technology doesn't work is no bar to success in the marketplace.    --Philip Greenspun


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

Предыдущее
От: Stef
Дата:
Сообщение: Preserving column order when recreating table.
Следующее
От: Stef
Дата:
Сообщение: Re: Preserving column order when recreating table.