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?