pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Don't create a shell type for function returning an array 7+ messages / 1 participants [nested] [flat]
* pgsql: Don't create a shell type for function returning an array @ 2026-08-27 12:06 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 7+ messages in thread From: Heikki Linnakangas @ 2026-08-27 12:06 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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/de673feb-41b4-4685-b24b-6408b95e58ab@iki.fi Backpatch-through: 14 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/2866d8c7dbfc9d882a7d80fef93fbbe763709932 Modified Files -------------- src/backend/commands/functioncmds.c | 58 +++++++++++++++++++------------ src/test/regress/expected/create_type.out | 50 +++++++++++++++++++++++++- src/test/regress/sql/create_type.sql | 42 ++++++++++++++++++++++ 3 files changed, 126 insertions(+), 24 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Don't create a shell type for function returning an array @ 2026-08-27 12:06 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 7+ messages in thread From: Heikki Linnakangas @ 2026-08-27 12:06 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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/de673feb-41b4-4685-b24b-6408b95e58ab@iki.fi Backpatch-through: 14 Branch ------ REL_19_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/ba12a202ce1b5581dc0ed149cf3f637d7897ad5d Modified Files -------------- src/backend/commands/functioncmds.c | 58 +++++++++++++++++++------------ src/test/regress/expected/create_type.out | 50 +++++++++++++++++++++++++- src/test/regress/sql/create_type.sql | 42 ++++++++++++++++++++++ 3 files changed, 126 insertions(+), 24 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Don't create a shell type for function returning an array @ 2026-08-27 12:06 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 7+ messages in thread From: Heikki Linnakangas @ 2026-08-27 12:06 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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/de673feb-41b4-4685-b24b-6408b95e58ab@iki.fi Backpatch-through: 14 Branch ------ REL_18_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/b90eeb29eea0cdbec236abc9fbdf8f448c26f929 Modified Files -------------- src/backend/commands/functioncmds.c | 58 +++++++++++++++++++------------ src/test/regress/expected/create_type.out | 50 +++++++++++++++++++++++++- src/test/regress/sql/create_type.sql | 42 ++++++++++++++++++++++ 3 files changed, 126 insertions(+), 24 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Don't create a shell type for function returning an array @ 2026-08-27 12:06 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 7+ messages in thread From: Heikki Linnakangas @ 2026-08-27 12:06 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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/de673feb-41b4-4685-b24b-6408b95e58ab@iki.fi Backpatch-through: 14 Branch ------ REL_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/b62206043be298dfdf493d5dc4bcac9e573a99ce 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(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Don't create a shell type for function returning an array @ 2026-08-27 12:06 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 7+ messages in thread From: Heikki Linnakangas @ 2026-08-27 12:06 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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/de673feb-41b4-4685-b24b-6408b95e58ab@iki.fi 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(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Don't create a shell type for function returning an array @ 2026-08-27 12:06 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 7+ messages in thread From: Heikki Linnakangas @ 2026-08-27 12:06 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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/de673feb-41b4-4685-b24b-6408b95e58ab@iki.fi Backpatch-through: 14 Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/b76b966c2dd53d01f08be0973e1eaa16a3028727 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(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Don't create a shell type for function returning an array @ 2026-08-27 12:06 Heikki Linnakangas <heikki.linnakangas@iki.fi> 0 siblings, 0 replies; 7+ messages in thread From: Heikki Linnakangas @ 2026-08-27 12:06 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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/de673feb-41b4-4685-b24b-6408b95e58ab@iki.fi Backpatch-through: 14 Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/ba2ea49b3cba05a948d38afe6191a4338e063dce Modified Files -------------- src/backend/commands/functioncmds.c | 58 ++++++++++++++---------- src/test/regress/expected/create_type.out | 22 ++++++++- src/test/regress/input/create_function_1.source | 25 ++++++++++ src/test/regress/output/create_function_1.source | 24 ++++++++++ src/test/regress/sql/create_type.sql | 16 +++++++ 5 files changed, 121 insertions(+), 24 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2026-08-27 12:06 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2026-08-27 12:06 pgsql: Don't create a shell type for function returning an array Heikki Linnakangas <heikki.linnakangas@iki.fi> 2026-08-27 12:06 pgsql: Don't create a shell type for function returning an array Heikki Linnakangas <heikki.linnakangas@iki.fi> 2026-08-27 12:06 pgsql: Don't create a shell type for function returning an array Heikki Linnakangas <heikki.linnakangas@iki.fi> 2026-08-27 12:06 pgsql: Don't create a shell type for function returning an array Heikki Linnakangas <heikki.linnakangas@iki.fi> 2026-08-27 12:06 pgsql: Don't create a shell type for function returning an array Heikki Linnakangas <heikki.linnakangas@iki.fi> 2026-08-27 12:06 pgsql: Don't create a shell type for function returning an array Heikki Linnakangas <heikki.linnakangas@iki.fi> 2026-08-27 12:06 pgsql: Don't create a shell type for function returning an array Heikki Linnakangas <heikki.linnakangas@iki.fi>
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