ERROR: cannot convert relation containing dropped columns to view

Поиск
Список
Период
Сортировка
От Nicklas Avén
Тема ERROR: cannot convert relation containing dropped columns to view
Дата
Msg-id 1456176604.17219.9.camel@jordogskog.no
обсуждение исходный текст
Ответ на Re: Proper use of Groups and Users (Roles).  (Vincent Veyron <vv.lists@wanadoo.fr>)
Ответы Re: ERROR: cannot convert relation containing dropped columns to view  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hello

I get this error message :
ERROR:  cannot convert relation containing dropped columns to view

I have googled, but find only very old posts that doesn't seem to be the
same situation.

What I have done is that I have a quite big table that I added a column
to for deletion time.

Then I droped that column and added it again with the right type.

After that I cannot create a rule that is returning data.

The reason I have to return data is irrelevant here, but PostgREST
expects that.

To reproduce:
create table foo
(
id serial,
deleted int
);

alter table foo drop column deleted;
alter table foo add column deleted timestamp;

CREATE or replace RULE del_post AS ON DELETE TO foo
DO INSTEAD
update foo set deleted = now()
WHERE id = OLD.id
returning *;

returns:
ERROR:  cannot convert relation containing dropped columns to view


If I don't drop any column (adding the right type at once) it works as
expected.

two questions:
1) is this a bug
2) is there a way to "cean" the table from the deleted columns without
recreating it?

Best Regards

Nicklas Avén




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

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: Why does query planner choose slower BitmapAnd ?
Следующее
От: Melvin Davidson
Дата:
Сообщение: Re: Read-only tables to avoid row visibility check