Re: SELECT CAST(123 AS char) -> 1 - Mailing list pgsql-general

From Ken Johanson
Subject Re: SELECT CAST(123 AS char) -> 1
Date
Msg-id 47B23E65.4070600@kensystem.com
Whole thread Raw
In response to Re: SELECT CAST(123 AS char) -> 1  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Tom Lane wrote:
>
>> Simply that a commonly used database (my) does not support it.
>
> They do support char(n) in this context, which would have the advantage
> of being standards compliant as well as de-facto portable.
>


Hmm, interesting. Mysql actual returns:
select cast(123 AS char(10)) -> '123' (agreed wrong since length is
explicit)

And PG (Ms also) gives:
select cast(123 AS char(10)) -> '123 ' (tested via jdbc driver since
hard to visualize the space in psql)

and PG:
select '='||cast(123 AS char(10))||'=' -> '=123=' (test via psql)



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: SELECT CAST(123 AS char) -> 1
Next
From: "Dean Gibson (DB Administrator)"
Date:
Subject: Re: SELECT CAST(123 AS char) -> 1