| From: | Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com> |
|---|---|
| To: | Marcos Pegoraro <marcos(at)f10(dot)com(dot)br> |
| Cc: | Mark Wong <markwkm(at)gmail(dot)com>, Álvaro Herrera <alvherre(at)kurilemu(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: [PATCH] Add pg_get_policy_ddl() function to reconstruct CREATE POLICY statement |
| Date: | 2025-11-20 09:27:05 |
| Message-ID: | CANxoLDfD_MnK+2=XrWr_fZRh1qbLriO=7MbbZ9UAcwktydFnBA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Attached is the v8 patch for your review, with updated variable names and a
rebase applied.
On Mon, Nov 10, 2025 at 10:46 AM Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com>
wrote:
> Thanks for the clarification. However, I still believe this is out of
> scope for the CREATE POLICY DDL. The command ALTER TABLE ... ENABLE ROW
> LEVEL SECURITY seems more appropriate as part of the CREATE TABLE
> reconstruction rather than CREATE POLICY.
>
> That said, I’m open to adding it if the majority feels it should be
> included in this feature.
>
> On Fri, Nov 7, 2025 at 8:18 PM Marcos Pegoraro <marcos(at)f10(dot)com(dot)br> wrote:
>
>> Em sex., 7 de nov. de 2025 às 11:27, Akshay Joshi <
>> akshay(dot)joshi(at)enterprisedb(dot)com> escreveu:
>>
>>> I don’t think we need that statement. Could you please elaborate on
>>> where exactly it needs to be added?
>>>
>>
>> well, these pg_get_..._ddl() functions will be cool for compare/clone
>> schemas in a multi tenant world.
>> Instead of dump/sed/restore a schema to create a new one, I could use
>> something like
>> select pg_get_table_ddl(oid) from pg_class where nspname = 'customer_050'
>> and relkind = 'r' union all
>> select pg_get_constraint_ddl(oid) from pg_constraint inner join pg_class
>> on ... where ... union all
>> select pg_get_trigger_ddl(oid) from pg_trigger inner join pg_class on
>> ... where ... union all
>> ...
>>
>> And pg_get_policy_ddl() will be part of these union all selects
>>
>> Because that would be good to worry about create that only if it does not
>> exists or drop first too.
>>
>> regards
>> Marcos
>>
>
| Attachment | Content-Type | Size |
|---|---|---|
| v8-0001-Add-pg_get_policy_ddl-function-to-reconstruct-CREATE.patch | application/x-patch | 26.1 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Christoph Berg | 2025-11-20 09:31:59 | Re: pg_utility ? |
| Previous Message | shveta malik | 2025-11-20 09:26:59 | Re: POC: enable logical decoding when wal_level = 'replica' without a server restart |