Léo*_* 준영 6 php postgresql boolean
我无法相信以下陈述似乎仍然是真的
So, I switched to integers and 0 or 1 works fine, but it is
stupid, that the database system has boolean variables of a smaller
size, but I should use integers for boolean values!
Run Code Online (Sandbox Code Playgroud)
你如何使用Postgres/PHP的布尔数据类型?
换一种说法,
获取布尔数据类型的类型是唯一使用1表示true而0表示false的方法吗?
使用 1 和 0 是表示布尔值的一种非常明智且可移植的方式。int 和本机布尔类型之间的任何大小差异实际上对应用程序的性能或数据库的 KB 大小几乎没有影响或没有影响。