Re: Change order of table-columns in pg_catalog.pg_attribute.attnum

Поиск
Список
Период
Сортировка
От Erwin Brandstetter
Тема Re: Change order of table-columns in pg_catalog.pg_attribute.attnum
Дата
Msg-id 1181143308.525613.238500@q75g2000hsh.googlegroups.com
обсуждение исходный текст
Ответ на Re: Change order of table-columns in pg_catalog.pg_attribute.attnum  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Change order of table-columns in pg_catalog.pg_attribute.attnum  ("Igor Neyman" <ineyman@perceptron.com>)
Список pgsql-admin
On Jun 6, 4:59 pm, t...@sss.pgh.pa.us (Tom Lane) wrote:
> Alvaro Herrera <alvhe...@commandprompt.com> writes:
> > Erwin Brandstetter escribi�:
> >> If I want to change the default order of two columns of a table, can I
> >> just manipulate the values in
> >> pg_catalog.pg_attribute.attnum?
> > It works -- as long as the table is empty.
>
> And as long as you have no views, foreign keys, indexes, defaults,
> rules, etc etc etc referencing the columns.
>
> Short answer is don't even think of trying it.

Thanks for your answers.
I had tried it with data in the table and it seemed to work, but it
does mess up views referencing the table. So, no go.

The only way to change the default order of columns is still to drop
the table and all references to it and recreate it all?


Regards
Erwin


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Change order of table-columns in pg_catalog.pg_attribute.attnum
Следующее
От: "Igor Neyman"
Дата:
Сообщение: Re: Change order of table-columns in pg_catalog.pg_attribute.attnum