Re: Preserving column order when recreating table.
От | Stef |
---|---|
Тема | Re: Preserving column order when recreating table. |
Дата | |
Msg-id | 20040915162201.13be5102@svb.ucs.co.za обсуждение исходный текст |
Ответ на | Re: Preserving column order when recreating table. (Andrew Sullivan <ajs@crankycanuck.ca>) |
Ответы |
Re: Preserving column order when recreating table.
Re: Preserving column order when recreating table. |
Список | pgsql-sql |
Andrew Sullivan mentioned : => I'm not sure why you want to do the former, but in any case, it's Because lazy people write inserts without specifying column names. => 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), I like this idea, but each database may have a different table definition for the same table, and if I want to automate this, I need to figure out the column names on the fly. => and then rename the old table, rename the new table to the old table => name, and drop the old table if you like. I think I've got the solution now. I'll do it in two steps. Fist add/drop all the columns that are not there/not supposed to be there, and in the second step do what you suggested. Thanks!! Kind Regards Stefan
В списке pgsql-sql по дате отправления: