0
我想在終端中使用psql來查找數據庫中的所有可空列。如果我使用在postgresql表中列出所有非空限制
select * from information_schema.check_constraints;
我得到的信息,如以下
constraint_catalog | constraint_schema | constraint_name | check_clause
--------------------+--------------------+------------------------------+----------------------------------------------------------------------------------------------
foo | public | 12345_67890_1_not_null | bar IS NOT NULL
不幸的是,列bar
出現在許多表。我可以通過簡單的方式獲得像這樣列出列名和表名的所有public
約束列表嗎?