PSQLexception: ERROR : type "signed" does not exist

来源:这里教程网 时间:2026-03-14 20:39:06 作者:

signed是MySQL特有的类型,Oracle和原生PostgreSQL都没有,当MySQL的代码有select cast( '1' as signed);跑在当前没有兼容类型的数据库上会报错

lightdb@postgres=# select cast('1' as signed);
ERROR:  type "signed" does not exist
LINE 1: select cast('1' as signed);
                            ^
lightdb@postgres=# create domain public.signed as bigint;
CREATE DOMAIN
lightdb@postgres=# select cast('1' as signed);
 signed 
--------
      1
(1 row)

相关推荐