Re: CREATE TABLE LIKE INCLUDING POLICIES - Mailing list pgsql-hackers

From jian he
Subject Re: CREATE TABLE LIKE INCLUDING POLICIES
Date
Msg-id CACJufxGg9cEs1P7p8Ak2oQ0F9AZQbHtdTcUzUpvsHZ9THeZOQw@mail.gmail.com
Whole thread Raw
In response to CREATE TABLE LIKE INCLUDING POLICIES  (jian he <jian.universality@gmail.com>)
List pgsql-hackers
hi.

to avoid repeated name lookup issue, I added a RangeTblEntry field to
CreatePolicyStmt.
see v2-0001-add-RangeTblEntry-to-CreatePolicyStmt.patch commit message too.

v2-0001, v2-0002 will be used in thread [1] too.
Please also check polished v2-0003.

The main logic is for each source table POLICY, using pg_policy catalog
information, produces a CreatePolicyStmt node. The source relation is already
locked in AccessShareLock, but POLICY qual, with check qual may reference other
unrelated relations, we also need to lock them in AccessShareLock too.

[1]: https://postgr.es/m/CACJufxE42vysVEDEmaoBGmGYLZTCgUAwh_h-c9dcSLDtD5jE3g@mail.gmail.com



--
jian
https://www.enterprisedb.com

Attachment

pgsql-hackers by date:

Previous
From: "zengman"
Date:
Subject: Re: Sequence Access Methods, round two
Next
From: Japin Li
Date:
Subject: Re: Allow GUC settings in CREATE SUBSCRIPTION CONNECTION to take effect