Re: BUG #17387: Working in PG13 but not in PGH14: array_agg(RECORD)
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: james.inform@pharmapp.de,
PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2022-01-28T23:48:00Z
Lists: pgsql-bugs
Attachments
- fix-missing-coercion-check.patch (text/x-diff) patch
I wrote: > So it seems like this is specific to type record[] somehow. Ah, no, I found it: the callers of select_common_type_from_oids assume that its result is guaranteed valid, which is not so. We need to explicitly check can_coerce_type. This oversight allows check_generic_type_consistency to succeed when it should not, which in turn allows us to decide that record and record[] are OK as matches to all three of those operators. This apparently escaped notice before because we've only tested cases in which incompatible arguments were of different typcategory. record and record[] are both of category 'P', which might be a dumb idea. But this would be a bug anyway. We need something like the attached, but I'm going to nose around for other oversights. regards, tom lane
Commits
-
Fix failure to validate the result of select_common_type().
- c025067f6d3f 14.2 landed
- 8e2e0f75869e 15.0 landed
- 5ad70564f46a 13.6 landed
-
Declare assorted array functions using anycompatible not anyelement.
- 9e38c2bb5093 14.0 cited