Search Postgresql Archives

How to convert integer to boolean in insert

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

 



for table
foo
  banned:boolean

When try  run 'insert into foo(banned) values(0)'
It returns
ERROR:  column "banned" is of type boolean but expression is of type
integer
LINE 1:  insert into foo(banned) values(0)

and I found a way to add the cast
insert into foo(banned) values(0::boolean)
but I have a big table which dump from mysqldump and covert by
mysql2pgsql. all of boolean relation values is 0 instead of '0' or
FALSE.

Is there any way to make pgsql implicit cast the integer to boolean?

Thanks
--
Miao

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[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