小编dev*_*xer的帖子

为什么 information_schema 有“YES”和“NO”字符串而不是布尔值?

我惊讶地发现is_nullable此查询的列被键入character varying (3)而不是boolean

select
    column_name,
    data_type,
    is_nullable
from
    information_schema.columns
where
    table_schema = 'public';
Run Code Online (Sandbox Code Playgroud)

我注意到其他一些列也使用“是”/“否”。这样做的理由是什么?我最初的想法是,也许除了 "YES" 和 "NO" 之外的其他值也是可能的,证明 a 以外的其他值是合理的boolean,但我在当前的数据库中没有看到任何这样的例子。

postgresql information-schema sql-standard

7
推荐指数
1
解决办法
1409
查看次数