PostgresQL 中的上下文 NULL 是什么意思
What does citext NULL mean in PostgresSQL
这在 Postgre 中是什么意思SQL
columnName citext NULL
我正在做一些 SQL 更改,数据库中有数据,但没有显示在前端。想知道这个 NULL 是否会使值进入空状态?
来自文档
The citext module provides a case-insensitive character string type, citext. Essentially, it internally calls lower when comparing values. Otherwise, it behaves almost exactly like text.
[字段类型后为 NULL]
(https://www.postgresql.org/docs/current/ddl-constraints.html)
来自文档 this simply selects the default behavior that the column might be null. The NULL constraint is not present in the SQL standard and should not be used in portable applications. (It was only added to PostgreSQL to be compatible with some other database systems.)
您显示的部分没有任何意义,不会按原样运行。
这可能是 table 定义的一部分。如果您需要 CITEXT 和 TEXT 或 VARCHAR 之间存在差异的更多详细信息,您应该查看文档:documentation
末尾的“NULL”仅表示该列可以为空。如果它让你感到困惑,你可以删除它。相反的是 columnName citext NOT NULL。整个 create table 命令看起来像这样:
CREATE TABLE example
(
columnName CITEXT NULL,
columnName2 CITEXT NOT NULL
);
当您想插入或更新此 table 的行时,只有第一列可以为空。第二列需要一个非空值。例如,此插入将成功:
INSERT INTO example VALUES (NULL,'1');
但是这个会失败:
INSERT INTO example VALUES ('1',NULL);
这在 Postgre 中是什么意思SQL
columnName citext NULL
我正在做一些 SQL 更改,数据库中有数据,但没有显示在前端。想知道这个 NULL 是否会使值进入空状态?
来自文档
The citext module provides a case-insensitive character string type, citext. Essentially, it internally calls lower when comparing values. Otherwise, it behaves almost exactly like text.
[字段类型后为 NULL]
(https://www.postgresql.org/docs/current/ddl-constraints.html)
来自文档 this simply selects the default behavior that the column might be null. The NULL constraint is not present in the SQL standard and should not be used in portable applications. (It was only added to PostgreSQL to be compatible with some other database systems.)
您显示的部分没有任何意义,不会按原样运行。 这可能是 table 定义的一部分。如果您需要 CITEXT 和 TEXT 或 VARCHAR 之间存在差异的更多详细信息,您应该查看文档:documentation
末尾的“NULL”仅表示该列可以为空。如果它让你感到困惑,你可以删除它。相反的是 columnName citext NOT NULL。整个 create table 命令看起来像这样:
CREATE TABLE example
(
columnName CITEXT NULL,
columnName2 CITEXT NOT NULL
);
当您想插入或更新此 table 的行时,只有第一列可以为空。第二列需要一个非空值。例如,此插入将成功:
INSERT INTO example VALUES (NULL,'1');
但是这个会失败:
INSERT INTO example VALUES ('1',NULL);