Re: CREATE TABLE LIKE INCLUDING POLICIES

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CREATE TABLE LIKE INCLUDING POLICIES
Date: 2026-01-21 05:02:27
Message-ID: CACJufxFLwhACUsOnywmZ=npLR44Egg=sivxnq4Giu_YJ4ZGT_A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

hi.

inspired by this message [1], now, v3 logic is more like other CREATE
TABLE LIKE INCLUDING commands.

Since policy queries can include SubLinks, we first acquire
AccessShareLock lock on all the referenced relations.
Only then we copy the USING and WITH CHECK clauses from the source relation.

[1] https://postgr.es/m/CA+TgmoY8v44Y8j--b7e72kuvupZdtMEZf6FVjRfeqsG4gunpzw@mail.gmail.com

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

Attachment Content-Type Size
v3-0001-CREATE-TABLE-LIKE-INCLUDING-POLICIES.patch text/x-patch 40.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2026-01-21 05:10:20 Re: support ALTER COLUMN SET EXPRESSION over virtual generated column with check constraint
Previous Message David Rowley 2026-01-21 05:00:21 Re: More speedups for tuple deformation