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

From: Ken Johanson <pg-user(at)kensystem(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: SELECT CAST(123 AS char) -> 1
Date: 2008-02-13 05:06:22
Message-ID: 47B27ACE.1060008@kensystem.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dean Gibson (DB Administrator) wrote:

>>
> Then I don't understand. While I've never used MySQL, the MySQL web
> pages apparently indicate that VARCHAR has been supported since version
> 3.2: http://dev.mysql.com/doc/refman/4.1/en/char.html
>
>

Only in DDL and not the cast function, apparently. Mysql 5.1 says:

select cast(123 AS varchar)
or
select cast(123 AS varchar(10))

You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near 'varchar)'
at line 1.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message bh yuan 2008-02-13 05:35:37 Re: character conversion problem about UTF-8-->SHIFT_JIS_2004
Previous Message Tom Lane 2008-02-13 04:34:56 Re: Storing images as BYTEA or large objects