Re: Resolve UNKNOWN type to relevant type instead of text type while bulk update using values

From: Sayyid Ali Sajjad Rizavi <sasrizavi(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Resolve UNKNOWN type to relevant type instead of text type while bulk update using values
Date: 2023-01-05 06:30:39
Message-ID: CAHxW8BCw5vOTsmd=XKYSM+vX4qsOXqhz+r9KWOS_7jNMs6q0uw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
> Breaking working queries for this is not acceptable.

Good point, let's exclude Option 2.

> This happens when possible so any remaining cases are not possible. Or,
> at least apparently not worth the effort it would take to make work.

Actually this doesn't happen when all of the values in that position are
null. Or maybe I don't understand what you mean.
If we don't consider the effort it would take to make it work, do you think
Option 1 would be good to have? Because when I
have an integer column in that position, I wouldn't want the unknown (null)
values I supply to be resolved to `text` type.

On Thu, Jan 5, 2023 at 11:23 AM David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:

> On Wednesday, January 4, 2023, Sayyid Ali Sajjad Rizavi <
> sasrizavi(at)gmail(dot)com> wrote:
>>
>>
>> *Option 1:* Cast to the relevant column type in that position (to
>> `integer` in this case), whenever we have an unknown type.
>>
>
> This happens when possible so any remaining cases are not possible. Or,
> at least apparently not worth the effort it would take to make work.
>
>
>> *Option 2:* Always give error if unknown type is not casted to desired
>> type (`null::integer` will be necessary).
>>
>
> Breaking working queries for this is not acceptable.
>
> David J.
>
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2023-01-05 06:47:43 Re: on placeholder entries in view rule action query's range table
Previous Message David G. Johnston 2023-01-05 06:23:24 Re: Resolve UNKNOWN type to relevant type instead of text type while bulk update using values