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

From: Rahila Syed <rahilasyed90(at)gmail(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Assignment of valid collation for SET operations on queries with UNKNOWN types.
Date: 2017-01-03 12:27:35
Message-ID: CAH2L28v=9PFWvRb=1fZHo7uhdgie1cA2ZSTyE8Hy7u_Heh_KkQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)paquier(at)gmail(dot)com>
wrote:

> On Fri, Dec 30, 2016 at 1:30 PM, Ashutosh Bapat
> <ashutosh(dot)bapat(at)enterprisedb(dot)com> wrote:
> > On Thu, Dec 29, 2016 at 8:18 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)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
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2017-01-03 12:34:18 Re: Replication/backup defaults
Previous Message Kuntal Ghosh 2017-01-03 12:23:15 Re: pg_sequence catalog