Re: BUG #17909: CREATE SCHEMA AUTHORIZATION sch CREATE TABLE foo ( id INT ) will coredump
Richard Guo <guofenglinux@gmail.com>
From: Richard Guo <guofenglinux@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, hysong0101@163.com,
pgsql-bugs@lists.postgresql.org
Date: 2023-04-28T03:29:11Z
Lists: pgsql-bugs
On Fri, Apr 28, 2023 at 9:43 AM Michael Paquier <michael@paquier.xyz> wrote: > Attached is what I am finishing with, where I have reworked > transformCreateSchemaStmt() so as it uses in input the list of > elements from CREATE SCHEMA and the schema name computed depending on > the security context, documenting requirements on the way (note the > extra unconstify for the RangeVars' schemas). I have added a couple > of regression tests for all the object types that have schema > qualication checks, mixed with role specs and schema names. > > Thoughts, comments or objections? +1. I like the refactor of transformCreateSchemaStmt. BTW, the comment states that CreateSchemaStmtContext.stmtType is "CREATE SCHEMA" or "ALTER SCHEMA". But it seems that there is no chance to set it to "ALTER SCHEMA". So should we update that comment, or go even further to remove CreateSchemaStmtContext.stmtType since it is not used? Thanks Richard
Commits
-
Fix crashes with CREATE SCHEMA AUTHORIZATION and schema elements
- a9212716b3bf 11.20 landed
- 63f7e91ecf9f 12.15 landed
- 7e95a33b42e7 13.11 landed
- d29eba1987cb 14.8 landed
- b9ad73ad250b 15.3 landed
- 4dadd660f071 16.0 landed