创建测试表
create table lhc.test_boolean(cola boolean,colb boolean);
insert into lhc.test_boolean(cola,colb) values ('true','false');
insert into lhc.test_boolean(cola,colb) values ('t','f');
insert into lhc.test_boolean(cola,colb) values ('TRUE','FALSE');
insert into lhc.test_boolean(cola,colb) values ('yes','no');
insert into lhc.test_boolean(cola,colb) values ('y','n');
insert into lhc.test_boolean(cola,colb) values ('1','0');
insert into lhc.test_boolean(cola,colb) values (null,null);
insert into lhc.test_boolean(cola) values (null);
insert into lhc.test_boolean(colb) values (null);
delete from lhc.test_boolean where cola is null;
验证:
select * from lhc.test_boolean;
lhcdb@10.206.132.17:5432=>select * from lhc.test_boolean;
cola | colb
------+------
t | f
t | f
t | f
t | f
t | f
t | f
|(7 rows)