Re: function to_char(iso-8859-1) is not unique at character 8 - Mailing list pgsql-general

From Tom Lane
Subject Re: function to_char(iso-8859-1) is not unique at character 8
Date
Msg-id 1204404.1688652443@sss.pgh.pa.us
Whole thread Raw
In response to Re: function to_char(iso-8859-1) is not unique at character 8  (Ron <ronljohnsonjr@gmail.com>)
List pgsql-general
Ron <ronljohnsonjr@gmail.com> writes:
> On 7/6/23 04:19, gzh wrote:
>> when I execute the sql below , the to_char function caused the following 
>> error.
>> select TO_CHAR('1000000');

> Isn't '1000000' already a character string?

Nope; in the mind of the Postgres parser, it's a literal of unknown type,
with the actual type to be inferred from context.  There is a small
preference for resolving such a thing as being of text type, but only a
small one.  The rules are exactly the same as for an undecorated NULL
constant.

            regards, tom lane



pgsql-general by date:

Previous
From: Ron
Date:
Subject: Re: function to_char(iso-8859-1) is not unique at character 8
Next
From: gzh
Date:
Subject: Re: function to_char(iso-8859-1) is not unique at character 8