在 SQL Server 的上下文中,默认约束是可以通过系统视图查询的对象。我正在将表从 T-SQL 迁移到 Postgres,最终得到以下定义:
CREATE TABLE public.EntitiesSQLObjectNamesMapping
(
RecordGuid UUID NOT NULL,
IsInterfaceView BIT NOT NULL CONSTRAINT DF_EntitiesSQLObjectNamesMapping_IsInterfaceView DEFAULT (0::bit)
);
如您所见,我可以将名称设置为默认约束,但我找不到包含此名称的系统视图:
SELECT *
FROM pg_catalog.pg_constraint;
select *
from information_schema.columns col
where col.column_default is not null
and col.table_schema not in('information_schema', 'pg_catalog')
order by col.column_name;
此外,在文档中,我什至看不到有关此内容和语法本身的信息。
谁能指出我在哪里可以获得这些信息?