Re: Cannot convert partitioned table to a view

2022-10-09 Thread Kouber Saparev
> > The fact that creating a _RETURN rule for a table causes it to be > changed into a view. That's ugly and arguably dangerous. > > Right, thank you. Cheers, -- Kouber Saparev

Re: Cannot convert partitioned table to a view

2022-10-07 Thread Ron
On 10/7/22 15:27, Kouber Saparev wrote: На чт, 6.10.2022 г. в 17:02 ч. Tom Lane написа: That is an ancient backwards-compatibility hack that you should not rely on, and most certainly shouldn't try to make use of from user code.  It exists because very ancient versions of pg_dump di

Re: Cannot convert partitioned table to a view

2022-10-07 Thread Tom Lane
Kouber Saparev writes: > Excuse me, I didn't understand what was about to be ripped out then. The fact that creating a _RETURN rule for a table causes it to be changed into a view. That's ugly and arguably dangerous. regards, tom lane

Re: Cannot convert partitioned table to a view

2022-10-07 Thread Kouber Saparev
> > No ... what has that got to do with this? We don't particularly care > what a foreign table is referencing, as long as it acts like a table. > Thank you. > We're more likely to rip it out as no-longer-needed than to expand what it > does. Excuse me, I didn't understand what was about to

Re: Cannot convert partitioned table to a view

2022-10-07 Thread Tom Lane
Kouber Saparev writes: > Does that mean that the ability to point remote partitions to views (on the > remote side) will be forbidden in the future? No ... what has that got to do with this? We don't particularly care what a foreign table is referencing, as long as it acts like a table.

Re: Cannot convert partitioned table to a view

2022-10-07 Thread Kouber Saparev
На чт, 6.10.2022 г. в 17:02 ч. Tom Lane написа: > That is an ancient backwards-compatibility hack that you should not > rely on, and most certainly shouldn't try to make use of from user > code. It exists because very ancient versions of pg_dump didn't > know how to dump views as views. We're m

Re: Cannot convert partitioned table to a view

2022-10-06 Thread Tom Lane
Kouber Saparev writes: > 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. That is an ancient backwards-compatibility hack that you should not re

Cannot convert partitioned table to a view

2022-10-06 Thread Kouber Saparev
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 ...; ERROR: cannot convert partitioned table "xxx_20220715" to a view https://github.com/po