空值和所有列都为空的行类型之间有什么区别吗?Postgres 查询似乎能够区分差异(显示空列而不是空白),我想知道是否有什么我应该注意的。例如
CREATE TYPE node AS (
rank integer
, id integer
);
CREATE TABLE hierarchy (
node node
);
INSERT INTO hierarchy (node) VALUES (null);
INSERT INTO hierarchy (node) VALUES ((null, null));
SELECT *, node IS NULL AS check_null FROM hierarchy;
node | check_null ------+------------ | t (,) | t