Re: Assignment of valid collation for SET operations on queries with UNKNOWN types.

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Cc: Rahila Syed <rahilasyed90@gmail.com>, Michael Paquier <michael.paquier@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2016-12-29T14:48:08Z
Lists: pgsql-hackers
Ashutosh Bapat <ashutosh.bapat@enterprisedb.com> writes:
> The way this patch has been written, it doesn't allow creating tables
> with unknown type columns, which was allowed earlier.

Yes, that's an intentional change; creating such tables (or views) has
never been anything but a foot-gun.

However, I thought the idea was to silently coerce affected columns from
unknown to text.  This doesn't look like the behavior we want:

> You might want to add some testcases to test the error report e.g.
> (not necessarily in the same form) create view sv as select
> relname::unknown from pg_class;
> ERROR:  column "relname" has type "unknown"

			regards, tom lane


Commits

  1. Remove vestigial resolveUnknown arguments from transformSortClause etc.

  2. Make UNKNOWN into an actual pseudo-type.

  3. Change unknown-type literals to type text in SELECT and RETURNING lists.