Search Postgresql Archives

Re: SELECT CAST(123 AS char) -> 1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ken Johanson <pg-user@xxxxxxxxxxxxx> writes:
> Tom Lane wrote:
>> Hm, good point, so really we ought to have a separate casting path for
>> numeric types to char(n).  However, this section still doesn't offer
>> any support for the OP's desire to auto-size the result; it says
>> that you get an error if the result doesn't fit in the declared
>> length:
>> 
>>> iv) Otherwise, an exception condition is raised: data exception-
>>> string data, right truncation.

> I don't believe the size is being declared in the OP's (subject line) 
> example:  SELECT CAST(123 AS char)

No, because section 6.1 still defines what "char" means, and it says
that means "char(1)".

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
       message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux