Re: Resolve iso-8859-1 type to relevant type instead of text type while bulk update using values - Mailing list pgsql-hackers

From Sayyid Ali Sajjad Rizavi
Subject Re: Resolve iso-8859-1 type to relevant type instead of text type while bulk update using values
Date
Msg-id CAHxW8BCw5vOTsmd=XKYSM+vX4qsOXqhz+r9KWOS_7jNMs6q0uw@mail.gmail.com
Whole thread Raw
In response to Re: Resolve iso-8859-1 type to relevant type instead of text type while bulk update using values  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: Resolve iso-8859-1 type to relevant type instead of text type while bulk update using values
List 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.g.johnston@gmail.com> wrote:
On Wednesday, January 4, 2023, Sayyid Ali Sajjad Rizavi <sasrizavi@gmail.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.

pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Resolve iso-8859-1 type to relevant type instead of text type while bulk update using values
Next
From: Amit Langote
Date:
Subject: Re: on placeholder entries in view rule action query's range table