pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Don't crash on null pstate in coerce_record_to_complex(). 6+ messages / 1 participants [nested] [flat]
* pgsql: Don't crash on null pstate in coerce_record_to_complex(). @ 2026-11-18 02:55 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2026-11-18 02:55 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Don't crash on null pstate in coerce_record_to_complex(). Since commit 913bbd88d, this case is reachable if a SQL-language function returns a whole-row Var of type RECORD when its declared output type is a named composite type. We'd need the original ParseState to find out what the Var's columns are, but we don't have that structure at hand anymore. This didn't work before 913bbd88d either, but you got a slightly off-point error message instead of a crash. Given that this has never worked and there's been no field complaints about that before now, it doesn't seem worth doing major work to fix this. Let's just ensure that we throw a helpful error explaining what to do to work around the limitation. (The workaround actually reaches this same code, but does so while we still have the ParseState.) While at it, update various badly-obsolete comments about what coerce_type() uses its pstate argument for. Bug: #19906 Reported-by: Boris Murasov <murasovb@gmail.com> Author: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Ayush Tiwari <ayushtiwari.slg01@gmail.com> Discussion: https://postgr.es/m/19906-229033275b593ef0@postgresql.org Backpatch-through: 15 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/f76c8480f5550a684abf0fd4296e219fa0ee8324 Modified Files -------------- src/backend/parser/parse_coerce.c | 46 ++++++++++++++++++++------------ src/backend/parser/parse_expr.c | 4 +-- src/backend/parser/parse_func.c | 3 +-- src/test/regress/expected/rangefuncs.out | 9 ++++++- src/test/regress/sql/rangefuncs.sql | 7 ++++- 5 files changed, 45 insertions(+), 24 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Don't crash on null pstate in coerce_record_to_complex(). @ 2026-11-18 02:55 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2026-11-18 02:55 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Don't crash on null pstate in coerce_record_to_complex(). Since commit 913bbd88d, this case is reachable if a SQL-language function returns a whole-row Var of type RECORD when its declared output type is a named composite type. We'd need the original ParseState to find out what the Var's columns are, but we don't have that structure at hand anymore. This didn't work before 913bbd88d either, but you got a slightly off-point error message instead of a crash. Given that this has never worked and there's been no field complaints about that before now, it doesn't seem worth doing major work to fix this. Let's just ensure that we throw a helpful error explaining what to do to work around the limitation. (The workaround actually reaches this same code, but does so while we still have the ParseState.) While at it, update various badly-obsolete comments about what coerce_type() uses its pstate argument for. Bug: #19906 Reported-by: Boris Murasov <murasovb@gmail.com> Author: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Ayush Tiwari <ayushtiwari.slg01@gmail.com> Discussion: https://postgr.es/m/19906-229033275b593ef0@postgresql.org Backpatch-through: 15 Branch ------ REL_19_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/34574ebad5d16d522fb56aa8f1b01ac970b33377 Modified Files -------------- src/backend/parser/parse_coerce.c | 46 ++++++++++++++++++++------------ src/backend/parser/parse_expr.c | 4 +-- src/backend/parser/parse_func.c | 3 +-- src/test/regress/expected/rangefuncs.out | 9 ++++++- src/test/regress/sql/rangefuncs.sql | 7 ++++- 5 files changed, 45 insertions(+), 24 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Don't crash on null pstate in coerce_record_to_complex(). @ 2026-11-18 02:55 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2026-11-18 02:55 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Don't crash on null pstate in coerce_record_to_complex(). Since commit 913bbd88d, this case is reachable if a SQL-language function returns a whole-row Var of type RECORD when its declared output type is a named composite type. We'd need the original ParseState to find out what the Var's columns are, but we don't have that structure at hand anymore. This didn't work before 913bbd88d either, but you got a slightly off-point error message instead of a crash. Given that this has never worked and there's been no field complaints about that before now, it doesn't seem worth doing major work to fix this. Let's just ensure that we throw a helpful error explaining what to do to work around the limitation. (The workaround actually reaches this same code, but does so while we still have the ParseState.) While at it, update various badly-obsolete comments about what coerce_type() uses its pstate argument for. Bug: #19906 Reported-by: Boris Murasov <murasovb@gmail.com> Author: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Ayush Tiwari <ayushtiwari.slg01@gmail.com> Discussion: https://postgr.es/m/19906-229033275b593ef0@postgresql.org Backpatch-through: 15 Branch ------ REL_18_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/e755aff218790efe887de7a6aa7732b2384ed8c3 Modified Files -------------- src/backend/parser/parse_coerce.c | 46 ++++++++++++++++++++------------ src/backend/parser/parse_expr.c | 4 +-- src/backend/parser/parse_func.c | 3 +-- src/test/regress/expected/rangefuncs.out | 9 ++++++- src/test/regress/sql/rangefuncs.sql | 7 ++++- 5 files changed, 45 insertions(+), 24 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Don't crash on null pstate in coerce_record_to_complex(). @ 2026-11-18 02:55 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2026-11-18 02:55 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Don't crash on null pstate in coerce_record_to_complex(). Since commit 913bbd88d, this case is reachable if a SQL-language function returns a whole-row Var of type RECORD when its declared output type is a named composite type. We'd need the original ParseState to find out what the Var's columns are, but we don't have that structure at hand anymore. This didn't work before 913bbd88d either, but you got a slightly off-point error message instead of a crash. Given that this has never worked and there's been no field complaints about that before now, it doesn't seem worth doing major work to fix this. Let's just ensure that we throw a helpful error explaining what to do to work around the limitation. (The workaround actually reaches this same code, but does so while we still have the ParseState.) While at it, update various badly-obsolete comments about what coerce_type() uses its pstate argument for. Bug: #19906 Reported-by: Boris Murasov <murasovb@gmail.com> Author: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Ayush Tiwari <ayushtiwari.slg01@gmail.com> Discussion: https://postgr.es/m/19906-229033275b593ef0@postgresql.org Backpatch-through: 15 Branch ------ REL_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/59f0c2be1eccf49069dd74b11b5fa9f1e05d24ce Modified Files -------------- src/backend/parser/parse_coerce.c | 49 ++++++++++++++++++++------------ src/backend/parser/parse_expr.c | 4 +-- src/backend/parser/parse_func.c | 3 +- src/test/regress/expected/rangefuncs.out | 9 +++++- src/test/regress/sql/rangefuncs.sql | 7 ++++- 5 files changed, 47 insertions(+), 25 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Don't crash on null pstate in coerce_record_to_complex(). @ 2026-11-18 02:55 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2026-11-18 02:55 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Don't crash on null pstate in coerce_record_to_complex(). Since commit 913bbd88d, this case is reachable if a SQL-language function returns a whole-row Var of type RECORD when its declared output type is a named composite type. We'd need the original ParseState to find out what the Var's columns are, but we don't have that structure at hand anymore. This didn't work before 913bbd88d either, but you got a slightly off-point error message instead of a crash. Given that this has never worked and there's been no field complaints about that before now, it doesn't seem worth doing major work to fix this. Let's just ensure that we throw a helpful error explaining what to do to work around the limitation. (The workaround actually reaches this same code, but does so while we still have the ParseState.) While at it, update various badly-obsolete comments about what coerce_type() uses its pstate argument for. Bug: #19906 Reported-by: Boris Murasov <murasovb@gmail.com> Author: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Ayush Tiwari <ayushtiwari.slg01@gmail.com> Discussion: https://postgr.es/m/19906-229033275b593ef0@postgresql.org Backpatch-through: 15 Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/64f45756ed67895b3073b9f5ee42bdff27ad3a28 Modified Files -------------- src/backend/parser/parse_coerce.c | 49 ++++++++++++++++++++------------ src/backend/parser/parse_expr.c | 4 +-- src/backend/parser/parse_func.c | 3 +- src/test/regress/expected/rangefuncs.out | 9 +++++- src/test/regress/sql/rangefuncs.sql | 7 ++++- 5 files changed, 47 insertions(+), 25 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Don't crash on null pstate in coerce_record_to_complex(). @ 2026-11-18 02:55 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2026-11-18 02:55 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Don't crash on null pstate in coerce_record_to_complex(). Since commit 913bbd88d, this case is reachable if a SQL-language function returns a whole-row Var of type RECORD when its declared output type is a named composite type. We'd need the original ParseState to find out what the Var's columns are, but we don't have that structure at hand anymore. This didn't work before 913bbd88d either, but you got a slightly off-point error message instead of a crash. Given that this has never worked and there's been no field complaints about that before now, it doesn't seem worth doing major work to fix this. Let's just ensure that we throw a helpful error explaining what to do to work around the limitation. (The workaround actually reaches this same code, but does so while we still have the ParseState.) While at it, update various badly-obsolete comments about what coerce_type() uses its pstate argument for. Bug: #19906 Reported-by: Boris Murasov <murasovb@gmail.com> Author: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Ayush Tiwari <ayushtiwari.slg01@gmail.com> Discussion: https://postgr.es/m/19906-229033275b593ef0@postgresql.org Backpatch-through: 15 Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/5c9da8b0e226e6d269e443b166850ec739788e4f Modified Files -------------- src/backend/parser/parse_coerce.c | 48 ++++++++++++++++++++------------ src/backend/parser/parse_expr.c | 4 +-- src/backend/parser/parse_func.c | 3 +- src/test/regress/expected/rangefuncs.out | 9 +++++- src/test/regress/sql/rangefuncs.sql | 7 ++++- 5 files changed, 46 insertions(+), 25 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2026-11-18 02:55 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2026-11-18 02:55 pgsql: Don't crash on null pstate in coerce_record_to_complex(). Tom Lane <tgl@sss.pgh.pa.us> 2026-11-18 02:55 pgsql: Don't crash on null pstate in coerce_record_to_complex(). Tom Lane <tgl@sss.pgh.pa.us> 2026-11-18 02:55 pgsql: Don't crash on null pstate in coerce_record_to_complex(). Tom Lane <tgl@sss.pgh.pa.us> 2026-11-18 02:55 pgsql: Don't crash on null pstate in coerce_record_to_complex(). Tom Lane <tgl@sss.pgh.pa.us> 2026-11-18 02:55 pgsql: Don't crash on null pstate in coerce_record_to_complex(). Tom Lane <tgl@sss.pgh.pa.us> 2026-11-18 02:55 pgsql: Don't crash on null pstate in coerce_record_to_complex(). Tom Lane <tgl@sss.pgh.pa.us>
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