Cannot convert partitioned table to a view
| От | Kouber Saparev |
|---|---|
| Тема | Cannot convert partitioned table to a view |
| Дата | |
| Msg-id | CAN4RuQt7Yp3CX583y8KR9SbqdxaNo6BmR=RwKD1o=UypgE2bng@mail.gmail.com обсуждение исходный текст |
| Ответы |
Re: Cannot convert partitioned table to a view
|
| Список | pgsql-general |
Is there a special reason why masking views behind table partitions is not allowed?
Trying to do so raises an error:
CREATE RULE "_RETURN" AS ON SELECT TO xxx_20220715 DO INSTEAD SELECT * FROM yyy WHERE ...;
CREATE RULE "_RETURN" AS ON SELECT TO xxx_20220715 DO INSTEAD SELECT * FROM yyy WHERE ...;
ERROR: cannot convert partitioned table "xxx_20220715" to a view
That said, I can trick it if I have a view on a remote server and then attach it as a remote partition through the foreign data wrapper.
Are there any dangers that should be considered with such an approach?
I noticed that attaching the "_RETURN" rule to a table converts it to a view, and the operation is irreversible, i.e. once attached, I cannot drop the rule and put the relation back to a table one.
Are there any dangers that should be considered with such an approach?
I noticed that attaching the "_RETURN" rule to a table converts it to a view, and the operation is irreversible, i.e. once attached, I cannot drop the rule and put the relation back to a table one.
Cordially,
--
Kouber Saparev
В списке pgsql-general по дате отправления: