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

From Tom Lane
Subject Re: CREATE TABLE LIKE INCLUDING POLICIES
Date
Msg-id 546590.1771005826@sss.pgh.pa.us
Whole thread Raw
In response to CREATE TABLE LIKE INCLUDING POLICIES  (jian he <jian.universality@gmail.com>)
Responses Re: CREATE TABLE LIKE INCLUDING POLICIES
List pgsql-hackers
jian he <jian.universality@gmail.com> writes:
> +CREATE TABLE coll_t1(LIKE coll_t INCLUDING POLICIES);

I want to take a step back and debate whether such a feature is
a good idea at all.

What's bothering me in particular is that CREATE TABLE LIKE does
not (and cannot be told to) copy the source's ownership or ACL
permissions.  Does it make sense to copy RLS policies while
not copying those tightly-associated properties?  I'm inclined to
think not.

(And no, I'd not look favorably on a response that proposes to fix
that by adding the ability to copy ownership/permissions.  There
are probably security problems in such an idea.)

I'm especially distressed that this would presumably cause
INCLUDING ALL to copy policies too.  I think the odds of that
usually being the right thing would be small.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: add warning upon successful md5 password auth
Next
From: Corey Huinker
Date:
Subject: Re: Optional skipping of unchanged relations during ANALYZE?