ALTER TABLE ( smallinto -> boolean ) ...
От | Marc G. Fournier |
---|---|
Тема | ALTER TABLE ( smallinto -> boolean ) ... |
Дата | |
Msg-id | 20050829201253.X1044@ganymede.hub.org обсуждение исходный текст |
Ответы |
Re: ALTER TABLE ( smallinto -> boolean ) ...
Re: ALTER TABLE ( smallinto -> boolean ) ... Re: ALTER TABLE ( smallinto -> boolean ) ... |
Список | pgsql-hackers |
I have a table with several 'smallint' fields that I'd like to convert to booleean ... the data in each is either 0 or 1, and: # select '1'::boolean; bool ------ t (1 row) # select '0'::boolean; bool ------ f (1 row) so they do cast as expected ... but, if I try to do the ALTER, I get: # ALTER TABLE table ALTER COLUMN field1 type boolean; ERROR: column "field1" cannot be cast to type "pg_catalog.bool" Should this not work? If not, is there a way to do it so that it will, without having to reload the whole table? Thanks ... ---- Marc G. Fournier Hub.Org Networking Services (http://www.hub.org) Email: scrappy@hub.org Yahoo!: yscrappy ICQ: 7615664
В списке pgsql-hackers по дате отправления: