pgsql: Remove bogus Assert, add some regression test cases showing why.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Remove bogus Assert, add some regression test cases showing why.
Date: 2020-04-04 22:03:36
Message-ID: E1jKqt6-0006FU-IE@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Remove bogus Assert, add some regression test cases showing why.

Commit 77ec5affb added an assertion to enforce_generic_type_consistency
that boils down to "if the function result is polymorphic, there must be
at least one polymorphic argument". This should be true for user-created
functions, but there are built-in functions for which it's not true, as
pointed out by Jaime Casanova. Hence, go back to the old behavior of
leaving the return type alone. There's only a limited amount of stuff
you can do with such a function result, but it does work to some extent;
add some regression test cases to ensure we don't break that again.

Discussion: https://postgr.es/m/CAJGNTeMbhtsCUZgJJ8h8XxAJbK7U2ipsX8wkHRtZRz-NieT8RA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/07871d40c72e498b6e034eb674df5d8d206976bc

Modified Files
--------------
src/backend/parser/parse_coerce.c | 21 ++++++++++++---------
src/test/regress/expected/polymorphism.out | 13 +++++++++++++
src/test/regress/sql/polymorphism.sql | 5 +++++
3 files changed, 30 insertions(+), 9 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Noah Misch 2020-04-04 22:46:20 pgsql: Add perl2host call missing from a new test file.
Previous Message Noah Misch 2020-04-04 20:40:43 pgsql: Skip WAL for new relfilenodes, under wal_level=minimal.