pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedtable inheritance and privileges
3+ messages / 2 participants
[nested] [flat]
* table inheritance and privileges
@ 2022-09-28 19:17 Ted Toth <txtoth@gmail.com>
2022-09-28 19:49 ` Re: table inheritance and privileges Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 3+ messages in thread
From: Ted Toth @ 2022-09-28 19:17 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
I'm dynamically creating tables that inherit from another table but
they don't inherit the access privileges. Is there a way to have the
new tables inherit their parent tables access privileges?
Ted
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: table inheritance and privileges
2022-09-28 19:17 table inheritance and privileges Ted Toth <txtoth@gmail.com>
@ 2022-09-28 19:49 ` Tom Lane <tgl@sss.pgh.pa.us>
2022-09-28 21:42 ` Re: table inheritance and privileges Ted Toth <txtoth@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Tom Lane @ 2022-09-28 19:49 UTC (permalink / raw)
To: Ted Toth <txtoth@gmail.com>; +Cc: pgsql-general@lists.postgresql.org
Ted Toth <txtoth@gmail.com> writes:
> I'm dynamically creating tables that inherit from another table but
> they don't inherit the access privileges. Is there a way to have the
> new tables inherit their parent tables access privileges?
No, but do you need that? When accessing the parent table, there's
no need for privileges on individual children --- we only check
tables(s) directly named in the query.
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: table inheritance and privileges
2022-09-28 19:17 table inheritance and privileges Ted Toth <txtoth@gmail.com>
2022-09-28 19:49 ` Re: table inheritance and privileges Tom Lane <tgl@sss.pgh.pa.us>
@ 2022-09-28 21:42 ` Ted Toth <txtoth@gmail.com>
0 siblings, 0 replies; 3+ messages in thread
From: Ted Toth @ 2022-09-28 21:42 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-general@lists.postgresql.org
I have written a 'before insert' trigger using a similar technique to
that described in section 5.11.3 of :
https://www.postgresql.org/docs/14/ddl-partitioning.html#DDL-PARTITIONING-USING-INHERITANCE
However my trigger queries to see if the partition table exists,
creates it if it doesn't then inserts into it and returns 'SKIP'
(plpython3u).
On Wed, Sep 28, 2022 at 2:49 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Ted Toth <txtoth@gmail.com> writes:
> > I'm dynamically creating tables that inherit from another table but
> > they don't inherit the access privileges. Is there a way to have the
> > new tables inherit their parent tables access privileges?
>
> No, but do you need that? When accessing the parent table, there's
> no need for privileges on individual children --- we only check
> tables(s) directly named in the query.
>
> regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2022-09-28 21:42 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-09-28 19:17 table inheritance and privileges Ted Toth <txtoth@gmail.com>
2022-09-28 19:49 ` Tom Lane <tgl@sss.pgh.pa.us>
2022-09-28 21:42 ` Ted Toth <txtoth@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox