Search Postgresql Archives

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

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

 



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)



---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

[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