Re: [HACKERS] Assignment of valid collation for SET operations onqueries with UNKNOWN types. - Mailing list pgsql-hackers

From Rahila Syed
Subject Re: [HACKERS] Assignment of valid collation for SET operations onqueries with UNKNOWN types.
Date
Msg-id CAH2L28v=9PFWvRb=1fZHo7uhdgie1cA2ZSTyE8Hy7u_Heh_KkQ@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Assignment of valid collation for SET operations onqueries with UNKNOWN types.  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: [HACKERS] Assignment of valid collation for SET operations onqueries with UNKNOWN types.
List pgsql-hackers
Thank you all for inputs.
Kindly help me clarify the scope of the patch.

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

This patch prevents creation of relation with unknown columns and
in addition fixes the particular case of CREATE VIEW with literal columns
by coercing unknown to text only in this particular case.

Are you suggesting extending the patch to include coercing from unknown to
text for all possible cases where a column of unknown type is being created?
 
Thank you,
Rahila Syed


On Fri, Dec 30, 2016 at 7:21 PM, Michael Paquier <michael.paquier@gmail.com> wrote:
On Fri, Dec 30, 2016 at 1:30 PM, Ashutosh Bapat
<ashutosh.bapat@enterprisedb.com> wrote:
> On Thu, Dec 29, 2016 at 8:18 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> 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:
>
> Do you mean to say that when creating a table with a column of unknown
> type, that column type should be silently converted (there's nothing
> to coerce when the table is being created) to text? instead of
> throwing an error?

FWIW that's what I understood: the patch should switch unknown columns
to text. A bunch of side effects when converting types are avoided
this way.
--
Michael

pgsql-hackers by date:

Previous
From: Kuntal Ghosh
Date:
Subject: Re: [HACKERS] pg_sequence catalog
Next
From: Michael Paquier
Date:
Subject: Re: [HACKERS] Replication/backup defaults