Altering a table with a rowtype column

Поиск
Список
Период
Сортировка
От Mike Blackwell
Тема Altering a table with a rowtype column
Дата
Msg-id CANPAkgsA3CrSzK_soK_FTO4S9jcwkA2T4EmQ-=tDzSq7rOhsLg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Altering a table with a rowtype column  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-general
Given a pair of tables:

create table a (
  id serial,
  stuff text,
  more_stuff text
);

create table a_audit (
  id serial,
  old_record a,
  new_record a
);

How can one alter the structure of table a?  Attempting

ALTER TABLE a ADD COLUMN even_more_stuff text;

results in the message:

 ERROR:  cannot alter table "a" because column "a_audit.new_record" uses its row type

A solution that doesn't lose the existing data is preferable.

Mike

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: ERROR: could not find tuple for trigger 37463634
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: Altering a table with a rowtype column