rename column and trigger on column

Поиск
Список
Период
Сортировка
От Chris Sutton
Тема rename column and trigger on column
Дата
Msg-id Pine.LNX.4.33.0202150932020.29156-100000@zev.ifloor.com
обсуждение исходный текст
Список pgsql-bugs
create table ref_table (
  id serial primary key
  ref_name varchar);

create table data_table (
  a int4 references ref_table);

which of course creates 3 triggers.

If you do:

alter table data_table rename column a to b;

The trigger on data_table still looks for column named "a" so sometime in
the future you will probably get:

ERROR:  constraint <unnamed>: table data_table does not
have an attribute a

Possible solutions, along with telling the db admin to pay attention ;)

1. Check for triggers on column before allowing rename and if they
exist, give a warning of the trigger that needs to be recreated

2. Rebuild the trigger automatically

3. Delete the trigger

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

Предыдущее
От: "Detlef Plotzky"
Дата:
Сообщение: Bug with SQL-COPY in 7.2
Следующее
От: "Ed Erdman"
Дата:
Сообщение: Postgres 7.1 problem