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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rahila Syed <rahilasyed90(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Assignment of valid collation for SET operations on queries with UNKNOWN types.
Date: 2016-11-17 15:29:35
Message-ID: 5835.1479396575@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Rahila Syed <rahilasyed90(at)gmail(dot)com> writes:
> CASE 2:
> postgres=# create view v as select 'abc' a;
> 2016-11-16 15:28:48 IST WARNING: column "a" has type "unknown"
> 2016-11-16 15:28:48 IST DETAIL: Proceeding with relation creation anyway.
> WARNING: column "a" has type "unknown"
> DETAIL: Proceeding with relation creation anyway.
> CREATE VIEW

We really ought to make that a hard error. And ideally fix things so
that the type of the view column will be resolved as text, so that you
don't hit this condition in the first place; but there is no good that
comes out of allowing a view to be created like this.

> Attached WIP patch does that. Kindly let me know your opinion.

This is a seriously ugly kluge that's attacking the symptom not the
problem. Or really, a symptom not the problem. There are lots of
other symptoms, for instance

regression=# select * from v order by 1;
ERROR: failed to find conversion function from unknown to text

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-11-17 15:37:14 Re: Fun fact about autovacuum and orphan temp tables
Previous Message Tobias Bussmann 2016-11-17 15:07:00 Re: Parallel execution and prepared statements