Re: [HACKERS] PG10 Partitioned tables and relation_is_updatable()
От | Dean Rasheed |
---|---|
Тема | Re: [HACKERS] PG10 Partitioned tables and relation_is_updatable() |
Дата | |
Msg-id | CAEZATCUnNOKN8sLML9jUzxecALWpEXK3a3W7y0PgFR4+uhgc=g@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: [HACKERS] PG10 Partitioned tables and relation_is_updatable() (Joe Conway <mail@joeconway.com>) |
Список | pgsql-hackers |
On 11 June 2017 at 16:59, Joe Conway <mail@joeconway.com> wrote: > On 06/11/2017 08:55 AM, Joe Conway wrote: >> Yeah, I noticed the same while working on the RLS related patch. I did >> not see anything else in rewriteHandler.c but it is probably worth >> looking wider for other omissions. > > So in particular: > > #define RelationIsUsedAsCatalogTable(relation) \ > ((relation)->rd_options && \ > ((relation)->rd_rel->relkind == RELKIND_RELATION || \ > (relation)->rd_rel->relkind == RELKIND_MATVIEW) ? \ > ((StdRdOptions *) (relation)->rd_options)->user_catalog_table : false) > 8<---------------------------- > > Does RELKIND_PARTITIONED_TABLE apply there? > Hmm, a quick experiment shows that it won't allow a partitioned table to be used as a user catalog table, although I'm not sure if that's intentional. If it is, it doesn't appear to be documented. I found another RLS-related omission -- RemoveRoleFromObjectPolicy() doesn't work for partitioned tables, so DROP OWNED BY <role> will fail if there are any partitioned tables with RLS. I also found another couple of omissions in PL/pgSQL -- plpgsql_parse_cwordtype() and build_row_from_class(), so for example %rowtype doesn't work for partitioned tables. That's it for my quick once-over the code-base, but I'm not confident that will have caught everything. Regards, Dean
В списке pgsql-hackers по дате отправления: