Don't create a shell type for function returning an array Refactor the checks in the function to move all the conditions for when to attempt creating a shell type into one place. Add a check for the array syntax.
In addition to rejecting array syntax, another user-visible effect is that the error message is now different if the type specified a typmod. You now get "type does not exist" instead of the more specific "type modifier cannot be specified for shell type". That seems better; the implicit shell type creation exists only for backwards compatibility, and it never worked with type modifiers, so if there's a type modifier it's most likely not because the user tried to create a shell type, Add test for the array syntax, the type modifier, and some other cases for which we don't create shell types. Discussion: https://www.postgresql.org/message-id/[email protected] Backpatch-through: 14 Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/e5e841cc532cbb8c48bc7adec9c361b0f8fba8e1 Modified Files -------------- src/backend/commands/functioncmds.c | 58 +++++++++++++++++++------------ src/test/regress/expected/create_type.out | 46 +++++++++++++++++++++++- src/test/regress/sql/create_type.sql | 42 ++++++++++++++++++++++ 3 files changed, 122 insertions(+), 24 deletions(-)
