From e40a3e804320cc18fb780968c79761375a845ee0 Mon Sep 17 00:00:00 2001
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: Fri, 24 Feb 2023 12:02:10 +0100
Subject: [PATCH v3 3/3] have psql \d+ show the constraint name

---
 .../postgres_fdw/expected/postgres_fdw.out    |  20 +-
 contrib/test_decoding/expected/ddl.out        |  50 +-
 src/bin/psql/describe.c                       |  29 +-
 src/test/regress/expected/alter_table.out     |  74 +--
 src/test/regress/expected/collate.out         |   8 +-
 src/test/regress/expected/compression_1.out   |  72 +--
 src/test/regress/expected/copy2.out           |   8 +-
 src/test/regress/expected/create_table.out    | 142 ++---
 .../regress/expected/create_table_like.out    |  88 +--
 src/test/regress/expected/create_view.out     | 348 +++++------
 src/test/regress/expected/domain.out          |  16 +-
 src/test/regress/expected/expressions.out     |  36 +-
 src/test/regress/expected/foreign_data.out    | 580 +++++++++---------
 src/test/regress/expected/generated.out       |  12 +-
 src/test/regress/expected/identity.out        |  16 +-
 src/test/regress/expected/inherit.out         | 138 ++---
 src/test/regress/expected/insert.out          | 118 ++--
 src/test/regress/expected/limit.out           |  32 +-
 src/test/regress/expected/matview.out         |  90 +--
 src/test/regress/expected/polymorphism.out    |  14 +-
 src/test/regress/expected/psql.out            |  40 +-
 src/test/regress/expected/publication.out     |  88 +--
 .../regress/expected/replica_identity.out     |  30 +-
 src/test/regress/expected/rowsecurity.out     |  16 +-
 src/test/regress/expected/rules.out           |  78 +--
 src/test/regress/expected/stats_ext.out       |  10 +-
 src/test/regress/expected/tablesample.out     |  16 +-
 src/test/regress/expected/tablespace.out      |  16 +-
 src/test/regress/expected/triggers.out        |  18 +-
 src/test/regress/expected/updatable_views.out |  34 +-
 src/test/regress/expected/update.out          |  16 +-
 src/test/regress/expected/with.out            |   8 +-
 32 files changed, 1139 insertions(+), 1122 deletions(-)

diff --git a/contrib/postgres_fdw/expected/postgres_fdw.out b/contrib/postgres_fdw/expected/postgres_fdw.out
index 04a3ef450c..518658fe5c 100644
--- a/contrib/postgres_fdw/expected/postgres_fdw.out
+++ b/contrib/postgres_fdw/expected/postgres_fdw.out
@@ -6545,11 +6545,11 @@ CREATE FOREIGN TABLE foreign_tbl (a int, b int)
 CREATE VIEW rw_view AS SELECT * FROM foreign_tbl
   WHERE a < b WITH CHECK OPTION;
 \d+ rw_view
-                           View "public.rw_view"
- Column |  Type   | Collation | Nullable | Default | Storage | Description 
---------+---------+-----------+----------+---------+---------+-------------
- a      | integer |           |          |         | plain   | 
- b      | integer |           |          |         | plain   | 
+                                View "public.rw_view"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Description 
+--------+---------+-----------+---------------------+---------+---------+-------------
+ a      | integer |           |                     |         | plain   | 
+ b      | integer |           |                     |         | plain   | 
 View definition:
  SELECT a,
     b
@@ -6662,11 +6662,11 @@ ALTER TABLE parent_tbl ATTACH PARTITION foreign_tbl FOR VALUES FROM (0) TO (100)
 CREATE VIEW rw_view AS SELECT * FROM parent_tbl
   WHERE a < b WITH CHECK OPTION;
 \d+ rw_view
-                           View "public.rw_view"
- Column |  Type   | Collation | Nullable | Default | Storage | Description 
---------+---------+-----------+----------+---------+---------+-------------
- a      | integer |           |          |         | plain   | 
- b      | integer |           |          |         | plain   | 
+                                View "public.rw_view"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Description 
+--------+---------+-----------+---------------------+---------+---------+-------------
+ a      | integer |           |                     |         | plain   | 
+ b      | integer |           |                     |         | plain   | 
 View definition:
  SELECT a,
     b
diff --git a/contrib/test_decoding/expected/ddl.out b/contrib/test_decoding/expected/ddl.out
index 9a28b5ddc5..df28ceef7f 100644
--- a/contrib/test_decoding/expected/ddl.out
+++ b/contrib/test_decoding/expected/ddl.out
@@ -484,12 +484,12 @@ CREATE TABLE replication_metadata (
 WITH (user_catalog_table = true)
 ;
 \d+ replication_metadata
-                                                 Table "public.replication_metadata"
-  Column  |  Type   | Collation | Nullable |                     Default                      | Storage  | Stats target | Description 
-----------+---------+-----------+----------+--------------------------------------------------+----------+--------------+-------------
- id       | integer |           | not null | nextval('replication_metadata_id_seq'::regclass) | plain    |              | 
- relation | name    |           | not null |                                                  | plain    |              | 
- options  | text[]  |           |          |                                                  | extended |              | 
+                                                                Table "public.replication_metadata"
+  Column  |  Type   | Collation |          NOT NULL Constraint           |                     Default                      | Storage  | Stats target | Description 
+----------+---------+-----------+----------------------------------------+--------------------------------------------------+----------+--------------+-------------
+ id       | integer |           | replication_metadata_id_not_null       | nextval('replication_metadata_id_seq'::regclass) | plain    |              | 
+ relation | name    |           | replication_metadata_relation_not_null |                                                  | plain    |              | 
+ options  | text[]  |           |                                        |                                                  | extended |              | 
 Indexes:
     "replication_metadata_pkey" PRIMARY KEY, btree (id)
 Options: user_catalog_table=true
@@ -498,12 +498,12 @@ INSERT INTO replication_metadata(relation, options)
 VALUES ('foo', ARRAY['a', 'b']);
 ALTER TABLE replication_metadata RESET (user_catalog_table);
 \d+ replication_metadata
-                                                 Table "public.replication_metadata"
-  Column  |  Type   | Collation | Nullable |                     Default                      | Storage  | Stats target | Description 
-----------+---------+-----------+----------+--------------------------------------------------+----------+--------------+-------------
- id       | integer |           | not null | nextval('replication_metadata_id_seq'::regclass) | plain    |              | 
- relation | name    |           | not null |                                                  | plain    |              | 
- options  | text[]  |           |          |                                                  | extended |              | 
+                                                                Table "public.replication_metadata"
+  Column  |  Type   | Collation |          NOT NULL Constraint           |                     Default                      | Storage  | Stats target | Description 
+----------+---------+-----------+----------------------------------------+--------------------------------------------------+----------+--------------+-------------
+ id       | integer |           | replication_metadata_id_not_null       | nextval('replication_metadata_id_seq'::regclass) | plain    |              | 
+ relation | name    |           | replication_metadata_relation_not_null |                                                  | plain    |              | 
+ options  | text[]  |           |                                        |                                                  | extended |              | 
 Indexes:
     "replication_metadata_pkey" PRIMARY KEY, btree (id)
 
@@ -511,12 +511,12 @@ INSERT INTO replication_metadata(relation, options)
 VALUES ('bar', ARRAY['a', 'b']);
 ALTER TABLE replication_metadata SET (user_catalog_table = true);
 \d+ replication_metadata
-                                                 Table "public.replication_metadata"
-  Column  |  Type   | Collation | Nullable |                     Default                      | Storage  | Stats target | Description 
-----------+---------+-----------+----------+--------------------------------------------------+----------+--------------+-------------
- id       | integer |           | not null | nextval('replication_metadata_id_seq'::regclass) | plain    |              | 
- relation | name    |           | not null |                                                  | plain    |              | 
- options  | text[]  |           |          |                                                  | extended |              | 
+                                                                Table "public.replication_metadata"
+  Column  |  Type   | Collation |          NOT NULL Constraint           |                     Default                      | Storage  | Stats target | Description 
+----------+---------+-----------+----------------------------------------+--------------------------------------------------+----------+--------------+-------------
+ id       | integer |           | replication_metadata_id_not_null       | nextval('replication_metadata_id_seq'::regclass) | plain    |              | 
+ relation | name    |           | replication_metadata_relation_not_null |                                                  | plain    |              | 
+ options  | text[]  |           |                                        |                                                  | extended |              | 
 Indexes:
     "replication_metadata_pkey" PRIMARY KEY, btree (id)
 Options: user_catalog_table=true
@@ -529,13 +529,13 @@ ALTER TABLE replication_metadata ALTER COLUMN rewritemeornot TYPE text;
 ERROR:  cannot rewrite table "replication_metadata" used as a catalog table
 ALTER TABLE replication_metadata SET (user_catalog_table = false);
 \d+ replication_metadata
-                                                    Table "public.replication_metadata"
-     Column     |  Type   | Collation | Nullable |                     Default                      | Storage  | Stats target | Description 
-----------------+---------+-----------+----------+--------------------------------------------------+----------+--------------+-------------
- id             | integer |           | not null | nextval('replication_metadata_id_seq'::regclass) | plain    |              | 
- relation       | name    |           | not null |                                                  | plain    |              | 
- options        | text[]  |           |          |                                                  | extended |              | 
- rewritemeornot | integer |           |          |                                                  | plain    |              | 
+                                                                   Table "public.replication_metadata"
+     Column     |  Type   | Collation |          NOT NULL Constraint           |                     Default                      | Storage  | Stats target | Description 
+----------------+---------+-----------+----------------------------------------+--------------------------------------------------+----------+--------------+-------------
+ id             | integer |           | replication_metadata_id_not_null       | nextval('replication_metadata_id_seq'::regclass) | plain    |              | 
+ relation       | name    |           | replication_metadata_relation_not_null |                                                  | plain    |              | 
+ options        | text[]  |           |                                        |                                                  | extended |              | 
+ rewritemeornot | integer |           |                                        |                                                  | plain    |              | 
 Indexes:
     "replication_metadata_pkey" PRIMARY KEY, btree (id)
 Options: user_catalog_table=false
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index c8a0bb7b3a..63e9037b20 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -1853,9 +1853,20 @@ describeOneTableDetails(const char *schemaname,
 		appendPQExpBufferStr(&buf,
 							 ",\n  (SELECT pg_catalog.pg_get_expr(d.adbin, d.adrelid, true)"
 							 "\n   FROM pg_catalog.pg_attrdef d"
-							 "\n   WHERE d.adrelid = a.attrelid AND d.adnum = a.attnum AND a.atthasdef)"
-							 ",\n  a.attnotnull");
+							 "\n   WHERE d.adrelid = a.attrelid AND d.adnum = a.attnum AND a.atthasdef)");
 		attrdef_col = cols++;
+		if (verbose && pset.sversion >= 160000)
+		{
+			appendPQExpBuffer(&buf,
+							  ",\n  (SELECT CASE when contype = 'n' THEN conname ELSE '(primary key)' END"
+							  "\n   FROM pg_catalog.pg_constraint co"
+							  "\n   WHERE co.conrelid = '%s' AND co.contype IN ('n', 'p') "
+							  "\n   AND co.conkey @> array[attnum]"
+							  "\n   ORDER BY contype <> 'n' LIMIT 1) AS attnotnull",
+							  oid);
+		}
+		else
+			appendPQExpBufferStr(&buf, ",\n  a.attnotnull");
 		attnotnull_col = cols++;
 		appendPQExpBufferStr(&buf, ",\n  (SELECT c.collname FROM pg_catalog.pg_collation c, pg_catalog.pg_type t\n"
 							 "   WHERE c.oid = a.attcollation AND t.oid = a.atttypid AND a.attcollation <> t.typcollation) AS attcollation");
@@ -2019,7 +2030,8 @@ describeOneTableDetails(const char *schemaname,
 	if (show_column_details)
 	{
 		headers[cols++] = gettext_noop("Collation");
-		headers[cols++] = gettext_noop("Nullable");
+		headers[cols++] = verbose ?  gettext_noop("NOT NULL Constraint") :
+			gettext_noop("Nullable");
 		headers[cols++] = gettext_noop("Default");
 	}
 	if (isindexkey_col >= 0)
@@ -2064,9 +2076,14 @@ describeOneTableDetails(const char *schemaname,
 
 			printTableAddCell(&cont, PQgetvalue(res, i, attcoll_col), false, false);
 
-			printTableAddCell(&cont,
-							  strcmp(PQgetvalue(res, i, attnotnull_col), "t") == 0 ? "not null" : "",
-							  false, false);
+			if (verbose)
+				printTableAddCell(&cont,
+								  PQgetvalue(res, i, attnotnull_col),
+								  false, false);
+			else
+				printTableAddCell(&cont,
+								  strcmp(PQgetvalue(res, i, attnotnull_col), "t") == 0 ? "not null" : "",
+								  false, false);
 
 			identity = PQgetvalue(res, i, attidentity_col);
 			generated = PQgetvalue(res, i, attgenerated_col);
diff --git a/src/test/regress/expected/alter_table.out b/src/test/regress/expected/alter_table.out
index d19349b301..fac453c01b 100644
--- a/src/test/regress/expected/alter_table.out
+++ b/src/test/regress/expected/alter_table.out
@@ -2282,12 +2282,12 @@ ERROR:  column data type integer can only have storage PLAIN
 create index test_storage_idx on test_storage (b, a);
 alter table test_storage alter column a set storage external;
 \d+ test_storage
-                                     Table "public.test_storage"
- Column |  Type   | Collation | Nullable |      Default      | Storage  | Stats target | Description 
---------+---------+-----------+----------+-------------------+----------+--------------+-------------
- a      | text    |           |          |                   | external |              | 
- c      | text    |           |          |                   | plain    |              | 
- b      | integer |           |          | random()::integer | plain    |              | 
+                                          Table "public.test_storage"
+ Column |  Type   | Collation | NOT NULL Constraint |      Default      | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+-------------------+----------+--------------+-------------
+ a      | text    |           |                     |                   | external |              | 
+ c      | text    |           |                     |                   | plain    |              | 
+ b      | integer |           |                     | random()::integer | plain    |              | 
 Indexes:
     "test_storage_idx" btree (b, a)
 
@@ -2492,23 +2492,23 @@ insert into at_base_table values (23, 'skidoo');
 create view at_view_1 as select * from at_base_table bt;
 create view at_view_2 as select *, to_json(v1) as j from at_view_1 v1;
 \d+ at_view_1
-                          View "public.at_view_1"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- id     | integer |           |          |         | plain    | 
- stuff  | text    |           |          |         | extended | 
+                                View "public.at_view_1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ id     | integer |           |                     |         | plain    | 
+ stuff  | text    |           |                     |         | extended | 
 View definition:
  SELECT id,
     stuff
    FROM at_base_table bt;
 
 \d+ at_view_2
-                          View "public.at_view_2"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- id     | integer |           |          |         | plain    | 
- stuff  | text    |           |          |         | extended | 
- j      | json    |           |          |         | extended | 
+                                View "public.at_view_2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ id     | integer |           |                     |         | plain    | 
+ stuff  | text    |           |                     |         | extended | 
+ j      | json    |           |                     |         | extended | 
 View definition:
  SELECT id,
     stuff,
@@ -2530,12 +2530,12 @@ select * from at_view_2;
 
 create or replace view at_view_1 as select *, 2+2 as more from at_base_table bt;
 \d+ at_view_1
-                          View "public.at_view_1"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- id     | integer |           |          |         | plain    | 
- stuff  | text    |           |          |         | extended | 
- more   | integer |           |          |         | plain    | 
+                                View "public.at_view_1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ id     | integer |           |                     |         | plain    | 
+ stuff  | text    |           |                     |         | extended | 
+ more   | integer |           |                     |         | plain    | 
 View definition:
  SELECT id,
     stuff,
@@ -2543,12 +2543,12 @@ View definition:
    FROM at_base_table bt;
 
 \d+ at_view_2
-                          View "public.at_view_2"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- id     | integer |           |          |         | plain    | 
- stuff  | text    |           |          |         | extended | 
- j      | json    |           |          |         | extended | 
+                                View "public.at_view_2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ id     | integer |           |                     |         | plain    | 
+ stuff  | text    |           |                     |         | extended | 
+ j      | json    |           |                     |         | extended | 
 View definition:
  SELECT id,
     stuff,
@@ -4275,10 +4275,10 @@ DROP TABLE part_rpd;
 -- works fine
 ALTER TABLE range_parted2 DETACH PARTITION part_rp CONCURRENTLY;
 \d+ range_parted2
-                         Partitioned table "public.range_parted2"
- Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
---------+---------+-----------+----------+---------+---------+--------------+-------------
- a      | integer |           |          |         | plain   |              | 
+                              Partitioned table "public.range_parted2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ a      | integer |           |                     |         | plain   |              | 
 Partition key: RANGE (a)
 Number of partitions: 0
 
@@ -4619,10 +4619,10 @@ create publication pub1 for table alter1.t1, tables in schema alter2;
 reset client_min_messages;
 alter table alter1.t1 set schema alter2;
 \d+ alter2.t1
-                                    Table "alter2.t1"
- Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
---------+---------+-----------+----------+---------+---------+--------------+-------------
- a      | integer |           |          |         | plain   |              | 
+                                          Table "alter2.t1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ a      | integer |           |                     |         | plain   |              | 
 Publications:
     "pub1"
 
diff --git a/src/test/regress/expected/collate.out b/src/test/regress/expected/collate.out
index 0649564485..a37814570e 100644
--- a/src/test/regress/expected/collate.out
+++ b/src/test/regress/expected/collate.out
@@ -693,10 +693,10 @@ CREATE VIEW collate_on_int AS
 SELECT c1+1 AS c1p FROM
   (SELECT ('4' COLLATE "C")::INT AS c1) ss;
 \d+ collate_on_int
-                    View "collate_tests.collate_on_int"
- Column |  Type   | Collation | Nullable | Default | Storage | Description 
---------+---------+-----------+----------+---------+---------+-------------
- c1p    | integer |           |          |         | plain   | 
+                         View "collate_tests.collate_on_int"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Description 
+--------+---------+-----------+---------------------+---------+---------+-------------
+ c1p    | integer |           |                     |         | plain   | 
 View definition:
  SELECT c1 + 1 AS c1p
    FROM ( SELECT 4 AS c1) ss;
diff --git a/src/test/regress/expected/compression_1.out b/src/test/regress/expected/compression_1.out
index c0a47646eb..69555f6218 100644
--- a/src/test/regress/expected/compression_1.out
+++ b/src/test/regress/expected/compression_1.out
@@ -6,10 +6,10 @@ CREATE TABLE cmdata(f1 text COMPRESSION pglz);
 CREATE INDEX idx ON cmdata(f1);
 INSERT INTO cmdata VALUES(repeat('1234567890', 1000));
 \d+ cmdata
-                                        Table "public.cmdata"
- Column | Type | Collation | Nullable | Default | Storage  | Compression | Stats target | Description 
---------+------+-----------+----------+---------+----------+-------------+--------------+-------------
- f1     | text |           |          |         | extended | pglz        |              | 
+                                              Table "public.cmdata"
+ Column | Type | Collation | NOT NULL Constraint | Default | Storage  | Compression | Stats target | Description 
+--------+------+-----------+---------------------+---------+----------+-------------+--------------+-------------
+ f1     | text |           |                     |         | extended | pglz        |              | 
 Indexes:
     "idx" btree (f1)
 
@@ -46,10 +46,10 @@ LINE 1: SELECT SUBSTR(f1, 2000, 50) FROM cmdata1;
 -- copy with table creation
 SELECT * INTO cmmove1 FROM cmdata;
 \d+ cmmove1
-                                        Table "public.cmmove1"
- Column | Type | Collation | Nullable | Default | Storage  | Compression | Stats target | Description 
---------+------+-----------+----------+---------+----------+-------------+--------------+-------------
- f1     | text |           |          |         | extended |             |              | 
+                                             Table "public.cmmove1"
+ Column | Type | Collation | NOT NULL Constraint | Default | Storage  | Compression | Stats target | Description 
+--------+------+-----------+---------------------+---------+----------+-------------+--------------+-------------
+ f1     | text |           |                     |         | extended |             |              | 
 
 SELECT pg_column_compression(f1) FROM cmmove1;
  pg_column_compression 
@@ -133,41 +133,41 @@ DROP TABLE cmdata2;
 --test column type update varlena/non-varlena
 CREATE TABLE cmdata2 (f1 int);
 \d+ cmdata2
-                                         Table "public.cmdata2"
- Column |  Type   | Collation | Nullable | Default | Storage | Compression | Stats target | Description 
---------+---------+-----------+----------+---------+---------+-------------+--------------+-------------
- f1     | integer |           |          |         | plain   |             |              | 
+                                              Table "public.cmdata2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Compression | Stats target | Description 
+--------+---------+-----------+---------------------+---------+---------+-------------+--------------+-------------
+ f1     | integer |           |                     |         | plain   |             |              | 
 
 ALTER TABLE cmdata2 ALTER COLUMN f1 TYPE varchar;
 \d+ cmdata2
-                                              Table "public.cmdata2"
- Column |       Type        | Collation | Nullable | Default | Storage  | Compression | Stats target | Description 
---------+-------------------+-----------+----------+---------+----------+-------------+--------------+-------------
- f1     | character varying |           |          |         | extended |             |              | 
+                                                    Table "public.cmdata2"
+ Column |       Type        | Collation | NOT NULL Constraint | Default | Storage  | Compression | Stats target | Description 
+--------+-------------------+-----------+---------------------+---------+----------+-------------+--------------+-------------
+ f1     | character varying |           |                     |         | extended |             |              | 
 
 ALTER TABLE cmdata2 ALTER COLUMN f1 TYPE int USING f1::integer;
 \d+ cmdata2
-                                         Table "public.cmdata2"
- Column |  Type   | Collation | Nullable | Default | Storage | Compression | Stats target | Description 
---------+---------+-----------+----------+---------+---------+-------------+--------------+-------------
- f1     | integer |           |          |         | plain   |             |              | 
+                                              Table "public.cmdata2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Compression | Stats target | Description 
+--------+---------+-----------+---------------------+---------+---------+-------------+--------------+-------------
+ f1     | integer |           |                     |         | plain   |             |              | 
 
 --changing column storage should not impact the compression method
 --but the data should not be compressed
 ALTER TABLE cmdata2 ALTER COLUMN f1 TYPE varchar;
 ALTER TABLE cmdata2 ALTER COLUMN f1 SET COMPRESSION pglz;
 \d+ cmdata2
-                                              Table "public.cmdata2"
- Column |       Type        | Collation | Nullable | Default | Storage  | Compression | Stats target | Description 
---------+-------------------+-----------+----------+---------+----------+-------------+--------------+-------------
- f1     | character varying |           |          |         | extended | pglz        |              | 
+                                                    Table "public.cmdata2"
+ Column |       Type        | Collation | NOT NULL Constraint | Default | Storage  | Compression | Stats target | Description 
+--------+-------------------+-----------+---------------------+---------+----------+-------------+--------------+-------------
+ f1     | character varying |           |                     |         | extended | pglz        |              | 
 
 ALTER TABLE cmdata2 ALTER COLUMN f1 SET STORAGE plain;
 \d+ cmdata2
-                                              Table "public.cmdata2"
- Column |       Type        | Collation | Nullable | Default | Storage | Compression | Stats target | Description 
---------+-------------------+-----------+----------+---------+---------+-------------+--------------+-------------
- f1     | character varying |           |          |         | plain   | pglz        |              | 
+                                                   Table "public.cmdata2"
+ Column |       Type        | Collation | NOT NULL Constraint | Default | Storage | Compression | Stats target | Description 
+--------+-------------------+-----------+---------------------+---------+---------+-------------+--------------+-------------
+ f1     | character varying |           |                     |         | plain   | pglz        |              | 
 
 INSERT INTO cmdata2 VALUES (repeat('123456789', 800));
 SELECT pg_column_compression(f1) FROM cmdata2;
@@ -240,10 +240,10 @@ ERROR:  compression method lz4 not supported
 DETAIL:  This functionality requires the server to be built with lz4 support.
 INSERT INTO cmdata VALUES (repeat('123456789', 4004));
 \d+ cmdata
-                                        Table "public.cmdata"
- Column | Type | Collation | Nullable | Default | Storage  | Compression | Stats target | Description 
---------+------+-----------+----------+---------+----------+-------------+--------------+-------------
- f1     | text |           |          |         | extended | pglz        |              | 
+                                              Table "public.cmdata"
+ Column | Type | Collation | NOT NULL Constraint | Default | Storage  | Compression | Stats target | Description 
+--------+------+-----------+---------------------+---------+----------+-------------+--------------+-------------
+ f1     | text |           |                     |         | extended | pglz        |              | 
 Indexes:
     "idx" btree (f1)
 
@@ -256,10 +256,10 @@ SELECT pg_column_compression(f1) FROM cmdata;
 
 ALTER TABLE cmdata2 ALTER COLUMN f1 SET COMPRESSION default;
 \d+ cmdata2
-                                              Table "public.cmdata2"
- Column |       Type        | Collation | Nullable | Default | Storage | Compression | Stats target | Description 
---------+-------------------+-----------+----------+---------+---------+-------------+--------------+-------------
- f1     | character varying |           |          |         | plain   |             |              | 
+                                                   Table "public.cmdata2"
+ Column |       Type        | Collation | NOT NULL Constraint | Default | Storage | Compression | Stats target | Description 
+--------+-------------------+-----------+---------------------+---------+---------+-------------+--------------+-------------
+ f1     | character varying |           |                     |         | plain   |             |              | 
 
 -- test alter compression method for materialized views
 ALTER MATERIALIZED VIEW compressmv ALTER COLUMN x SET COMPRESSION lz4;
diff --git a/src/test/regress/expected/copy2.out b/src/test/regress/expected/copy2.out
index 090ef6c7a8..ae4d4e995d 100644
--- a/src/test/regress/expected/copy2.out
+++ b/src/test/regress/expected/copy2.out
@@ -530,10 +530,10 @@ begin
 end $$ language plpgsql immutable;
 alter table check_con_tbl add check (check_con_function(check_con_tbl.*));
 \d+ check_con_tbl
-                               Table "public.check_con_tbl"
- Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
---------+---------+-----------+----------+---------+---------+--------------+-------------
- f1     | integer |           |          |         | plain   |              | 
+                                    Table "public.check_con_tbl"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ f1     | integer |           |                     |         | plain   |              | 
 Check constraints:
     "check_con_tbl_check" CHECK (check_con_function(check_con_tbl.*))
 
diff --git a/src/test/regress/expected/create_table.out b/src/test/regress/expected/create_table.out
index 32102204a1..5f21714b13 100644
--- a/src/test/regress/expected/create_table.out
+++ b/src/test/regress/expected/create_table.out
@@ -293,11 +293,11 @@ Partition key: RANGE (a oid_ops, plusone(b), c, d COLLATE "C")
 Number of partitions: 0
 
 \d+ partitioned2
-                          Partitioned table "public.partitioned2"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- a      | integer |           |          |         | plain    |              | 
- b      | text    |           |          |         | extended |              | 
+                               Partitioned table "public.partitioned2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ a      | integer |           |                     |         | plain    |              | 
+ b      | text    |           |                     |         | extended |              | 
 Partition key: RANGE (((a + 1)), substr(b, 1, 5))
 Number of partitions: 0
 
@@ -306,11 +306,11 @@ ERROR:  no partition of relation "partitioned2" found for row
 DETAIL:  Partition key of the failing row contains ((a + 1), substr(b, 1, 5)) = (2, hello).
 CREATE TABLE part2_1 PARTITION OF partitioned2 FOR VALUES FROM (-1, 'aaaaa') TO (100, 'ccccc');
 \d+ part2_1
-                                  Table "public.part2_1"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- a      | integer |           |          |         | plain    |              | 
- b      | text    |           |          |         | extended |              | 
+                                        Table "public.part2_1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ a      | integer |           |                     |         | plain    |              | 
+ b      | text    |           |                     |         | extended |              | 
 Partition of: partitioned2 FOR VALUES FROM ('-1', 'aaaaa') TO (100, 'ccccc')
 Partition constraint: (((a + 1) IS NOT NULL) AND (substr(b, 1, 5) IS NOT NULL) AND (((a + 1) > '-1'::integer) OR (((a + 1) = '-1'::integer) AND (substr(b, 1, 5) >= 'aaaaa'::text))) AND (((a + 1) < 100) OR (((a + 1) = 100) AND (substr(b, 1, 5) < 'ccccc'::text))))
 
@@ -347,11 +347,11 @@ select * from partitioned where partitioned = '(1,2)'::partitioned;
 (2 rows)
 
 \d+ partitioned1
-                               Table "public.partitioned1"
- Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
---------+---------+-----------+----------+---------+---------+--------------+-------------
- a      | integer |           |          |         | plain   |              | 
- b      | integer |           |          |         | plain   |              | 
+                                     Table "public.partitioned1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ a      | integer |           |                     |         | plain   |              | 
+ b      | integer |           |                     |         | plain   |              | 
 Partition of: partitioned FOR VALUES IN ('(1,2)')
 Partition constraint: (((partitioned1.*)::partitioned IS DISTINCT FROM NULL) AND ((partitioned1.*)::partitioned = '(1,2)'::partitioned))
 
@@ -404,10 +404,10 @@ CREATE TABLE part_p2 PARTITION OF list_parted FOR VALUES IN (2);
 CREATE TABLE part_p3 PARTITION OF list_parted FOR VALUES IN ((2+1));
 CREATE TABLE part_null PARTITION OF list_parted FOR VALUES IN (null);
 \d+ list_parted
-                          Partitioned table "public.list_parted"
- Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
---------+---------+-----------+----------+---------+---------+--------------+-------------
- a      | integer |           |          |         | plain   |              | 
+                               Partitioned table "public.list_parted"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ a      | integer |           |                     |         | plain   |              | 
 Partition key: LIST (a)
 Partitions: part_null FOR VALUES IN (NULL),
             part_p1 FOR VALUES IN (1),
@@ -855,21 +855,21 @@ create table test_part_coll_cast2 partition of test_part_coll_posix for values f
 drop table test_part_coll_posix;
 -- Partition bound in describe output
 \d+ part_b
-                                   Table "public.part_b"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- a      | text    |           |          |         | extended |              | 
- b      | integer |           | not null | 1       | plain    |              | 
+                                        Table "public.part_b"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ a      | text    |           |                     |         | extended |              | 
+ b      | integer |           | part_b_b_not_null   | 1       | plain    |              | 
 Partition of: parted FOR VALUES IN ('b')
 Partition constraint: ((a IS NOT NULL) AND (a = 'b'::text))
 
 -- Both partition bound and partition key in describe output
 \d+ part_c
-                             Partitioned table "public.part_c"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- a      | text    |           |          |         | extended |              | 
- b      | integer |           | not null | 0       | plain    |              | 
+                                  Partitioned table "public.part_c"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ a      | text    |           |                     |         | extended |              | 
+ b      | integer |           | part_c_b_not_null   | 0       | plain    |              | 
 Partition of: parted FOR VALUES IN ('c')
 Partition constraint: ((a IS NOT NULL) AND (a = 'c'::text))
 Partition key: RANGE (b)
@@ -877,11 +877,11 @@ Partitions: part_c_1_10 FOR VALUES FROM (1) TO (10)
 
 -- a level-2 partition's constraint will include the parent's expressions
 \d+ part_c_1_10
-                                Table "public.part_c_1_10"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- a      | text    |           |          |         | extended |              | 
- b      | integer |           | not null | 0       | plain    |              | 
+                                      Table "public.part_c_1_10"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ a      | text    |           |                     |         | extended |              | 
+ b      | integer |           | part_c_b_not_null   | 0       | plain    |              | 
 Partition of: part_c FOR VALUES FROM (1) TO (10)
 Partition constraint: ((a IS NOT NULL) AND (a = 'c'::text) AND (b IS NOT NULL) AND (b >= 1) AND (b < 10))
 
@@ -910,46 +910,46 @@ Number of partitions: 4 (Use \d+ to list them.)
 CREATE TABLE range_parted4 (a int, b int, c int) PARTITION BY RANGE (abs(a), abs(b), c);
 CREATE TABLE unbounded_range_part PARTITION OF range_parted4 FOR VALUES FROM (MINVALUE, MINVALUE, MINVALUE) TO (MAXVALUE, MAXVALUE, MAXVALUE);
 \d+ unbounded_range_part
-                           Table "public.unbounded_range_part"
- Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
---------+---------+-----------+----------+---------+---------+--------------+-------------
- a      | integer |           |          |         | plain   |              | 
- b      | integer |           |          |         | plain   |              | 
- c      | integer |           |          |         | plain   |              | 
+                                 Table "public.unbounded_range_part"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ a      | integer |           |                     |         | plain   |              | 
+ b      | integer |           |                     |         | plain   |              | 
+ c      | integer |           |                     |         | plain   |              | 
 Partition of: range_parted4 FOR VALUES FROM (MINVALUE, MINVALUE, MINVALUE) TO (MAXVALUE, MAXVALUE, MAXVALUE)
 Partition constraint: ((abs(a) IS NOT NULL) AND (abs(b) IS NOT NULL) AND (c IS NOT NULL))
 
 DROP TABLE unbounded_range_part;
 CREATE TABLE range_parted4_1 PARTITION OF range_parted4 FOR VALUES FROM (MINVALUE, MINVALUE, MINVALUE) TO (1, MAXVALUE, MAXVALUE);
 \d+ range_parted4_1
-                              Table "public.range_parted4_1"
- Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
---------+---------+-----------+----------+---------+---------+--------------+-------------
- a      | integer |           |          |         | plain   |              | 
- b      | integer |           |          |         | plain   |              | 
- c      | integer |           |          |         | plain   |              | 
+                                   Table "public.range_parted4_1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ a      | integer |           |                     |         | plain   |              | 
+ b      | integer |           |                     |         | plain   |              | 
+ c      | integer |           |                     |         | plain   |              | 
 Partition of: range_parted4 FOR VALUES FROM (MINVALUE, MINVALUE, MINVALUE) TO (1, MAXVALUE, MAXVALUE)
 Partition constraint: ((abs(a) IS NOT NULL) AND (abs(b) IS NOT NULL) AND (c IS NOT NULL) AND (abs(a) <= 1))
 
 CREATE TABLE range_parted4_2 PARTITION OF range_parted4 FOR VALUES FROM (3, 4, 5) TO (6, 7, MAXVALUE);
 \d+ range_parted4_2
-                              Table "public.range_parted4_2"
- Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
---------+---------+-----------+----------+---------+---------+--------------+-------------
- a      | integer |           |          |         | plain   |              | 
- b      | integer |           |          |         | plain   |              | 
- c      | integer |           |          |         | plain   |              | 
+                                   Table "public.range_parted4_2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ a      | integer |           |                     |         | plain   |              | 
+ b      | integer |           |                     |         | plain   |              | 
+ c      | integer |           |                     |         | plain   |              | 
 Partition of: range_parted4 FOR VALUES FROM (3, 4, 5) TO (6, 7, MAXVALUE)
 Partition constraint: ((abs(a) IS NOT NULL) AND (abs(b) IS NOT NULL) AND (c IS NOT NULL) AND ((abs(a) > 3) OR ((abs(a) = 3) AND (abs(b) > 4)) OR ((abs(a) = 3) AND (abs(b) = 4) AND (c >= 5))) AND ((abs(a) < 6) OR ((abs(a) = 6) AND (abs(b) <= 7))))
 
 CREATE TABLE range_parted4_3 PARTITION OF range_parted4 FOR VALUES FROM (6, 8, MINVALUE) TO (9, MAXVALUE, MAXVALUE);
 \d+ range_parted4_3
-                              Table "public.range_parted4_3"
- Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
---------+---------+-----------+----------+---------+---------+--------------+-------------
- a      | integer |           |          |         | plain   |              | 
- b      | integer |           |          |         | plain   |              | 
- c      | integer |           |          |         | plain   |              | 
+                                   Table "public.range_parted4_3"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ a      | integer |           |                     |         | plain   |              | 
+ b      | integer |           |                     |         | plain   |              | 
+ c      | integer |           |                     |         | plain   |              | 
 Partition of: range_parted4 FOR VALUES FROM (6, 8, MINVALUE) TO (9, MAXVALUE, MAXVALUE)
 Partition constraint: ((abs(a) IS NOT NULL) AND (abs(b) IS NOT NULL) AND (c IS NOT NULL) AND ((abs(a) > 6) OR ((abs(a) = 6) AND (abs(b) >= 8))) AND (abs(a) <= 9))
 
@@ -981,11 +981,11 @@ SELECT obj_description('parted_col_comment'::regclass);
 (1 row)
 
 \d+ parted_col_comment
-                        Partitioned table "public.parted_col_comment"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target |  Description  
---------+---------+-----------+----------+---------+----------+--------------+---------------
- a      | integer |           |          |         | plain    |              | Partition key
- b      | text    |           |          |         | extended |              | 
+                             Partitioned table "public.parted_col_comment"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target |  Description  
+--------+---------+-----------+---------------------+---------+----------+--------------+---------------
+ a      | integer |           |                     |         | plain    |              | Partition key
+ b      | text    |           |                     |         | extended |              | 
 Partition key: LIST (a)
 Number of partitions: 0
 
@@ -998,10 +998,10 @@ HINT:  Specify storage parameters for its leaf partitions, instead.
 CREATE TABLE arrlp (a int[]) PARTITION BY LIST (a);
 CREATE TABLE arrlp12 PARTITION OF arrlp FOR VALUES IN ('{1}', '{2}');
 \d+ arrlp12
-                                   Table "public.arrlp12"
- Column |   Type    | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+-----------+-----------+----------+---------+----------+--------------+-------------
- a      | integer[] |           |          |         | extended |              | 
+                                         Table "public.arrlp12"
+ Column |   Type    | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+-----------+-----------+---------------------+---------+----------+--------------+-------------
+ a      | integer[] |           |                     |         | extended |              | 
 Partition of: arrlp FOR VALUES IN ('{1}', '{2}')
 Partition constraint: ((a IS NOT NULL) AND ((a = '{1}'::integer[]) OR (a = '{2}'::integer[])))
 
@@ -1011,10 +1011,10 @@ create table boolspart (a bool) partition by list (a);
 create table boolspart_t partition of boolspart for values in (true);
 create table boolspart_f partition of boolspart for values in (false);
 \d+ boolspart
-                           Partitioned table "public.boolspart"
- Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
---------+---------+-----------+----------+---------+---------+--------------+-------------
- a      | boolean |           |          |         | plain   |              | 
+                                Partitioned table "public.boolspart"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ a      | boolean |           |                     |         | plain   |              | 
 Partition key: LIST (a)
 Partitions: boolspart_f FOR VALUES IN (false),
             boolspart_t FOR VALUES IN (true)
diff --git a/src/test/regress/expected/create_table_like.out b/src/test/regress/expected/create_table_like.out
index 0ed94f1d2f..4e29ec7695 100644
--- a/src/test/regress/expected/create_table_like.out
+++ b/src/test/regress/expected/create_table_like.out
@@ -327,32 +327,32 @@ CREATE TABLE ctlt4 (a text, c text);
 ALTER TABLE ctlt4 ALTER COLUMN c SET STORAGE EXTERNAL;
 CREATE TABLE ctlt12_storage (LIKE ctlt1 INCLUDING STORAGE, LIKE ctlt2 INCLUDING STORAGE);
 \d+ ctlt12_storage
-                             Table "public.ctlt12_storage"
- Column | Type | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+------+-----------+----------+---------+----------+--------------+-------------
- a      | text |           | not null |         | main     |              | 
- b      | text |           |          |         | extended |              | 
- c      | text |           |          |         | external |              | 
+                                   Table "public.ctlt12_storage"
+ Column | Type | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+------+-----------+---------------------+---------+----------+--------------+-------------
+ a      | text |           |                     |         | main     |              | 
+ b      | text |           |                     |         | extended |              | 
+ c      | text |           |                     |         | external |              | 
 
 CREATE TABLE ctlt12_comments (LIKE ctlt1 INCLUDING COMMENTS, LIKE ctlt2 INCLUDING COMMENTS);
 \d+ ctlt12_comments
-                             Table "public.ctlt12_comments"
- Column | Type | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+------+-----------+----------+---------+----------+--------------+-------------
- a      | text |           | not null |         | extended |              | A
- b      | text |           |          |         | extended |              | B
- c      | text |           |          |         | extended |              | C
+                                  Table "public.ctlt12_comments"
+ Column | Type | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+------+-----------+---------------------+---------+----------+--------------+-------------
+ a      | text |           |                     |         | extended |              | A
+ b      | text |           |                     |         | extended |              | B
+ c      | text |           |                     |         | extended |              | C
 
 CREATE TABLE ctlt1_inh (LIKE ctlt1 INCLUDING CONSTRAINTS INCLUDING COMMENTS) INHERITS (ctlt1);
 NOTICE:  merging column "a" with inherited definition
 NOTICE:  merging column "b" with inherited definition
 NOTICE:  merging constraint "ctlt1_a_check" with inherited definition
 \d+ ctlt1_inh
-                                Table "public.ctlt1_inh"
- Column | Type | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+------+-----------+----------+---------+----------+--------------+-------------
- a      | text |           | not null |         | main     |              | A
- b      | text |           |          |         | extended |              | B
+                                      Table "public.ctlt1_inh"
+ Column | Type | Collation | NOT NULL Constraint  | Default | Storage  | Stats target | Description 
+--------+------+-----------+----------------------+---------+----------+--------------+-------------
+ a      | text |           | ctlt1_inh_a_not_null |         | main     |              | A
+ b      | text |           |                      |         | extended |              | B
 Check constraints:
     "ctlt1_a_check" CHECK (length(a) > 2)
 Inherits: ctlt1
@@ -366,12 +366,12 @@ SELECT description FROM pg_description, pg_constraint c WHERE classoid = 'pg_con
 CREATE TABLE ctlt13_inh () INHERITS (ctlt1, ctlt3);
 NOTICE:  merging multiple inherited definitions of column "a"
 \d+ ctlt13_inh
-                               Table "public.ctlt13_inh"
- Column | Type | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+------+-----------+----------+---------+----------+--------------+-------------
- a      | text |           | not null |         | main     |              | 
- b      | text |           |          |         | extended |              | 
- c      | text |           |          |         | external |              | 
+                                      Table "public.ctlt13_inh"
+ Column | Type | Collation |  NOT NULL Constraint  | Default | Storage  | Stats target | Description 
+--------+------+-----------+-----------------------+---------+----------+--------------+-------------
+ a      | text |           | ctlt13_inh_a_not_null |         | main     |              | 
+ b      | text |           |                       |         | extended |              | 
+ c      | text |           |                       |         | external |              | 
 Check constraints:
     "ctlt1_a_check" CHECK (length(a) > 2)
     "ctlt3_a_check" CHECK (length(a) < 5)
@@ -382,12 +382,12 @@ Inherits: ctlt1,
 CREATE TABLE ctlt13_like (LIKE ctlt3 INCLUDING CONSTRAINTS INCLUDING INDEXES INCLUDING COMMENTS INCLUDING STORAGE) INHERITS (ctlt1);
 NOTICE:  merging column "a" with inherited definition
 \d+ ctlt13_like
-                               Table "public.ctlt13_like"
- Column | Type | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+------+-----------+----------+---------+----------+--------------+-------------
- a      | text |           | not null |         | main     |              | A3
- b      | text |           |          |         | extended |              | 
- c      | text |           |          |         | external |              | C
+                                      Table "public.ctlt13_like"
+ Column | Type | Collation |  NOT NULL Constraint   | Default | Storage  | Stats target | Description 
+--------+------+-----------+------------------------+---------+----------+--------------+-------------
+ a      | text |           | ctlt13_like_a_not_null |         | main     |              | A3
+ b      | text |           |                        |         | extended |              | 
+ c      | text |           |                        |         | external |              | C
 Indexes:
     "ctlt13_like_expr_idx" btree ((a || c))
 Check constraints:
@@ -404,11 +404,11 @@ SELECT description FROM pg_description, pg_constraint c WHERE classoid = 'pg_con
 
 CREATE TABLE ctlt_all (LIKE ctlt1 INCLUDING ALL);
 \d+ ctlt_all
-                                Table "public.ctlt_all"
- Column | Type | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+------+-----------+----------+---------+----------+--------------+-------------
- a      | text |           | not null |         | main     |              | A
- b      | text |           |          |         | extended |              | B
+                                      Table "public.ctlt_all"
+ Column | Type | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+------+-----------+---------------------+---------+----------+--------------+-------------
+ a      | text |           | (primary key)       |         | main     |              | A
+ b      | text |           |                     |         | extended |              | B
 Indexes:
     "ctlt_all_pkey" PRIMARY KEY, btree (a)
     "ctlt_all_b_idx" btree (b)
@@ -444,11 +444,11 @@ DETAIL:  MAIN versus EXTENDED
 -- Check that LIKE isn't confused by a system catalog of the same name
 CREATE TABLE pg_attrdef (LIKE ctlt1 INCLUDING ALL);
 \d+ public.pg_attrdef
-                               Table "public.pg_attrdef"
- Column | Type | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+------+-----------+----------+---------+----------+--------------+-------------
- a      | text |           | not null |         | main     |              | A
- b      | text |           |          |         | extended |              | B
+                                     Table "public.pg_attrdef"
+ Column | Type | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+------+-----------+---------------------+---------+----------+--------------+-------------
+ a      | text |           | (primary key)       |         | main     |              | A
+ b      | text |           |                     |         | extended |              | B
 Indexes:
     "pg_attrdef_pkey" PRIMARY KEY, btree (a)
     "pg_attrdef_b_idx" btree (b)
@@ -466,11 +466,11 @@ CREATE SCHEMA ctl_schema;
 SET LOCAL search_path = ctl_schema, public;
 CREATE TABLE ctlt1 (LIKE ctlt1 INCLUDING ALL);
 \d+ ctlt1
-                                Table "ctl_schema.ctlt1"
- Column | Type | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+------+-----------+----------+---------+----------+--------------+-------------
- a      | text |           | not null |         | main     |              | A
- b      | text |           |          |         | extended |              | B
+                                     Table "ctl_schema.ctlt1"
+ Column | Type | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+------+-----------+---------------------+---------+----------+--------------+-------------
+ a      | text |           | (primary key)       |         | main     |              | A
+ b      | text |           |                     |         | extended |              | B
 Indexes:
     "ctlt1_pkey" PRIMARY KEY, btree (a)
     "ctlt1_b_idx" btree (b)
diff --git a/src/test/regress/expected/create_view.out b/src/test/regress/expected/create_view.out
index 61825ef7d4..dc4bb828ea 100644
--- a/src/test/regress/expected/create_view.out
+++ b/src/test/regress/expected/create_view.out
@@ -358,14 +358,14 @@ SELECT relname, relkind, reloptions FROM pg_class
 CREATE VIEW unspecified_types AS
   SELECT 42 as i, 42.5 as num, 'foo' as u, 'foo'::unknown as u2, null as n;
 \d+ unspecified_types
-                   View "testviewschm2.unspecified_types"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- i      | integer |           |          |         | plain    | 
- num    | numeric |           |          |         | main     | 
- u      | text    |           |          |         | extended | 
- u2     | text    |           |          |         | extended | 
- n      | text    |           |          |         | extended | 
+                        View "testviewschm2.unspecified_types"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ i      | integer |           |                     |         | plain    | 
+ num    | numeric |           |                     |         | main     | 
+ u      | text    |           |                     |         | extended | 
+ u2     | text    |           |                     |         | extended | 
+ n      | text    |           |                     |         | extended | 
 View definition:
  SELECT 42 AS i,
     42.5 AS num,
@@ -387,13 +387,13 @@ CREATE VIEW tt1 AS
        ('0123456789', 'abc'::varchar(3), 42.12, 'abc'::varchar(4))
   ) vv(a,b,c,d);
 \d+ tt1
-                                View "testviewschm2.tt1"
- Column |         Type         | Collation | Nullable | Default | Storage  | Description 
---------+----------------------+-----------+----------+---------+----------+-------------
- a      | character varying    |           |          |         | extended | 
- b      | character varying    |           |          |         | extended | 
- c      | numeric              |           |          |         | main     | 
- d      | character varying(4) |           |          |         | extended | 
+                                      View "testviewschm2.tt1"
+ Column |         Type         | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+----------------------+-----------+---------------------+---------+----------+-------------
+ a      | character varying    |           |                     |         | extended | 
+ b      | character varying    |           |                     |         | extended | 
+ c      | numeric              |           |                     |         | main     | 
+ d      | character varying(4) |           |                     |         | extended | 
 View definition:
  SELECT a,
     b,
@@ -433,12 +433,12 @@ CREATE VIEW aliased_view_4 AS
   select * from temp_view_test.tt1
     where exists (select 1 from tt1 where temp_view_test.tt1.y1 = tt1.f1);
 \d+ aliased_view_1
-                    View "testviewschm2.aliased_view_1"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- f1     | integer |           |          |         | plain    | 
- f2     | integer |           |          |         | plain    | 
- f3     | text    |           |          |         | extended | 
+                          View "testviewschm2.aliased_view_1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ f1     | integer |           |                     |         | plain    | 
+ f2     | integer |           |                     |         | plain    | 
+ f3     | text    |           |                     |         | extended | 
 View definition:
  SELECT f1,
     f2,
@@ -449,12 +449,12 @@ View definition:
           WHERE tt1.f1 = tx1.x1));
 
 \d+ aliased_view_2
-                    View "testviewschm2.aliased_view_2"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- f1     | integer |           |          |         | plain    | 
- f2     | integer |           |          |         | plain    | 
- f3     | text    |           |          |         | extended | 
+                          View "testviewschm2.aliased_view_2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ f1     | integer |           |                     |         | plain    | 
+ f2     | integer |           |                     |         | plain    | 
+ f3     | text    |           |                     |         | extended | 
 View definition:
  SELECT f1,
     f2,
@@ -465,12 +465,12 @@ View definition:
           WHERE a1.f1 = tx1.x1));
 
 \d+ aliased_view_3
-                    View "testviewschm2.aliased_view_3"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- f1     | integer |           |          |         | plain    | 
- f2     | integer |           |          |         | plain    | 
- f3     | text    |           |          |         | extended | 
+                          View "testviewschm2.aliased_view_3"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ f1     | integer |           |                     |         | plain    | 
+ f2     | integer |           |                     |         | plain    | 
+ f3     | text    |           |                     |         | extended | 
 View definition:
  SELECT f1,
     f2,
@@ -481,12 +481,12 @@ View definition:
           WHERE tt1.f1 = a2.x1));
 
 \d+ aliased_view_4
-                    View "testviewschm2.aliased_view_4"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- y1     | integer |           |          |         | plain    | 
- f2     | integer |           |          |         | plain    | 
- f3     | text    |           |          |         | extended | 
+                          View "testviewschm2.aliased_view_4"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ y1     | integer |           |                     |         | plain    | 
+ f2     | integer |           |                     |         | plain    | 
+ f3     | text    |           |                     |         | extended | 
 View definition:
  SELECT y1,
     f2,
@@ -498,12 +498,12 @@ View definition:
 
 ALTER TABLE tx1 RENAME TO a1;
 \d+ aliased_view_1
-                    View "testviewschm2.aliased_view_1"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- f1     | integer |           |          |         | plain    | 
- f2     | integer |           |          |         | plain    | 
- f3     | text    |           |          |         | extended | 
+                          View "testviewschm2.aliased_view_1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ f1     | integer |           |                     |         | plain    | 
+ f2     | integer |           |                     |         | plain    | 
+ f3     | text    |           |                     |         | extended | 
 View definition:
  SELECT f1,
     f2,
@@ -514,12 +514,12 @@ View definition:
           WHERE tt1.f1 = a1.x1));
 
 \d+ aliased_view_2
-                    View "testviewschm2.aliased_view_2"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- f1     | integer |           |          |         | plain    | 
- f2     | integer |           |          |         | plain    | 
- f3     | text    |           |          |         | extended | 
+                          View "testviewschm2.aliased_view_2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ f1     | integer |           |                     |         | plain    | 
+ f2     | integer |           |                     |         | plain    | 
+ f3     | text    |           |                     |         | extended | 
 View definition:
  SELECT f1,
     f2,
@@ -530,12 +530,12 @@ View definition:
           WHERE a1.f1 = a1_1.x1));
 
 \d+ aliased_view_3
-                    View "testviewschm2.aliased_view_3"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- f1     | integer |           |          |         | plain    | 
- f2     | integer |           |          |         | plain    | 
- f3     | text    |           |          |         | extended | 
+                          View "testviewschm2.aliased_view_3"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ f1     | integer |           |                     |         | plain    | 
+ f2     | integer |           |                     |         | plain    | 
+ f3     | text    |           |                     |         | extended | 
 View definition:
  SELECT f1,
     f2,
@@ -546,12 +546,12 @@ View definition:
           WHERE tt1.f1 = a2.x1));
 
 \d+ aliased_view_4
-                    View "testviewschm2.aliased_view_4"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- y1     | integer |           |          |         | plain    | 
- f2     | integer |           |          |         | plain    | 
- f3     | text    |           |          |         | extended | 
+                          View "testviewschm2.aliased_view_4"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ y1     | integer |           |                     |         | plain    | 
+ f2     | integer |           |                     |         | plain    | 
+ f3     | text    |           |                     |         | extended | 
 View definition:
  SELECT y1,
     f2,
@@ -563,12 +563,12 @@ View definition:
 
 ALTER TABLE tt1 RENAME TO a2;
 \d+ aliased_view_1
-                    View "testviewschm2.aliased_view_1"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- f1     | integer |           |          |         | plain    | 
- f2     | integer |           |          |         | plain    | 
- f3     | text    |           |          |         | extended | 
+                          View "testviewschm2.aliased_view_1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ f1     | integer |           |                     |         | plain    | 
+ f2     | integer |           |                     |         | plain    | 
+ f3     | text    |           |                     |         | extended | 
 View definition:
  SELECT f1,
     f2,
@@ -579,12 +579,12 @@ View definition:
           WHERE a2.f1 = a1.x1));
 
 \d+ aliased_view_2
-                    View "testviewschm2.aliased_view_2"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- f1     | integer |           |          |         | plain    | 
- f2     | integer |           |          |         | plain    | 
- f3     | text    |           |          |         | extended | 
+                          View "testviewschm2.aliased_view_2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ f1     | integer |           |                     |         | plain    | 
+ f2     | integer |           |                     |         | plain    | 
+ f3     | text    |           |                     |         | extended | 
 View definition:
  SELECT f1,
     f2,
@@ -595,12 +595,12 @@ View definition:
           WHERE a1.f1 = a1_1.x1));
 
 \d+ aliased_view_3
-                    View "testviewschm2.aliased_view_3"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- f1     | integer |           |          |         | plain    | 
- f2     | integer |           |          |         | plain    | 
- f3     | text    |           |          |         | extended | 
+                          View "testviewschm2.aliased_view_3"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ f1     | integer |           |                     |         | plain    | 
+ f2     | integer |           |                     |         | plain    | 
+ f3     | text    |           |                     |         | extended | 
 View definition:
  SELECT f1,
     f2,
@@ -611,12 +611,12 @@ View definition:
           WHERE a2.f1 = a2_1.x1));
 
 \d+ aliased_view_4
-                    View "testviewschm2.aliased_view_4"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- y1     | integer |           |          |         | plain    | 
- f2     | integer |           |          |         | plain    | 
- f3     | text    |           |          |         | extended | 
+                          View "testviewschm2.aliased_view_4"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ y1     | integer |           |                     |         | plain    | 
+ f2     | integer |           |                     |         | plain    | 
+ f3     | text    |           |                     |         | extended | 
 View definition:
  SELECT y1,
     f2,
@@ -628,12 +628,12 @@ View definition:
 
 ALTER TABLE a1 RENAME TO tt1;
 \d+ aliased_view_1
-                    View "testviewschm2.aliased_view_1"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- f1     | integer |           |          |         | plain    | 
- f2     | integer |           |          |         | plain    | 
- f3     | text    |           |          |         | extended | 
+                          View "testviewschm2.aliased_view_1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ f1     | integer |           |                     |         | plain    | 
+ f2     | integer |           |                     |         | plain    | 
+ f3     | text    |           |                     |         | extended | 
 View definition:
  SELECT f1,
     f2,
@@ -644,12 +644,12 @@ View definition:
           WHERE a2.f1 = tt1.x1));
 
 \d+ aliased_view_2
-                    View "testviewschm2.aliased_view_2"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- f1     | integer |           |          |         | plain    | 
- f2     | integer |           |          |         | plain    | 
- f3     | text    |           |          |         | extended | 
+                          View "testviewschm2.aliased_view_2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ f1     | integer |           |                     |         | plain    | 
+ f2     | integer |           |                     |         | plain    | 
+ f3     | text    |           |                     |         | extended | 
 View definition:
  SELECT f1,
     f2,
@@ -660,12 +660,12 @@ View definition:
           WHERE a1.f1 = tt1.x1));
 
 \d+ aliased_view_3
-                    View "testviewschm2.aliased_view_3"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- f1     | integer |           |          |         | plain    | 
- f2     | integer |           |          |         | plain    | 
- f3     | text    |           |          |         | extended | 
+                          View "testviewschm2.aliased_view_3"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ f1     | integer |           |                     |         | plain    | 
+ f2     | integer |           |                     |         | plain    | 
+ f3     | text    |           |                     |         | extended | 
 View definition:
  SELECT f1,
     f2,
@@ -676,12 +676,12 @@ View definition:
           WHERE a2.f1 = a2_1.x1));
 
 \d+ aliased_view_4
-                    View "testviewschm2.aliased_view_4"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- y1     | integer |           |          |         | plain    | 
- f2     | integer |           |          |         | plain    | 
- f3     | text    |           |          |         | extended | 
+                          View "testviewschm2.aliased_view_4"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ y1     | integer |           |                     |         | plain    | 
+ f2     | integer |           |                     |         | plain    | 
+ f3     | text    |           |                     |         | extended | 
 View definition:
  SELECT y1,
     f2,
@@ -694,12 +694,12 @@ View definition:
 ALTER TABLE a2 RENAME TO tx1;
 ALTER TABLE tx1 SET SCHEMA temp_view_test;
 \d+ aliased_view_1
-                    View "testviewschm2.aliased_view_1"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- f1     | integer |           |          |         | plain    | 
- f2     | integer |           |          |         | plain    | 
- f3     | text    |           |          |         | extended | 
+                          View "testviewschm2.aliased_view_1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ f1     | integer |           |                     |         | plain    | 
+ f2     | integer |           |                     |         | plain    | 
+ f3     | text    |           |                     |         | extended | 
 View definition:
  SELECT f1,
     f2,
@@ -710,12 +710,12 @@ View definition:
           WHERE tx1.f1 = tt1.x1));
 
 \d+ aliased_view_2
-                    View "testviewschm2.aliased_view_2"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- f1     | integer |           |          |         | plain    | 
- f2     | integer |           |          |         | plain    | 
- f3     | text    |           |          |         | extended | 
+                          View "testviewschm2.aliased_view_2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ f1     | integer |           |                     |         | plain    | 
+ f2     | integer |           |                     |         | plain    | 
+ f3     | text    |           |                     |         | extended | 
 View definition:
  SELECT f1,
     f2,
@@ -726,12 +726,12 @@ View definition:
           WHERE a1.f1 = tt1.x1));
 
 \d+ aliased_view_3
-                    View "testviewschm2.aliased_view_3"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- f1     | integer |           |          |         | plain    | 
- f2     | integer |           |          |         | plain    | 
- f3     | text    |           |          |         | extended | 
+                          View "testviewschm2.aliased_view_3"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ f1     | integer |           |                     |         | plain    | 
+ f2     | integer |           |                     |         | plain    | 
+ f3     | text    |           |                     |         | extended | 
 View definition:
  SELECT f1,
     f2,
@@ -742,12 +742,12 @@ View definition:
           WHERE tx1.f1 = a2.x1));
 
 \d+ aliased_view_4
-                    View "testviewschm2.aliased_view_4"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- y1     | integer |           |          |         | plain    | 
- f2     | integer |           |          |         | plain    | 
- f3     | text    |           |          |         | extended | 
+                          View "testviewschm2.aliased_view_4"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ y1     | integer |           |                     |         | plain    | 
+ f2     | integer |           |                     |         | plain    | 
+ f3     | text    |           |                     |         | extended | 
 View definition:
  SELECT y1,
     f2,
@@ -761,12 +761,12 @@ ALTER TABLE temp_view_test.tt1 RENAME TO tmp1;
 ALTER TABLE temp_view_test.tmp1 SET SCHEMA testviewschm2;
 ALTER TABLE tmp1 RENAME TO tx1;
 \d+ aliased_view_1
-                    View "testviewschm2.aliased_view_1"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- f1     | integer |           |          |         | plain    | 
- f2     | integer |           |          |         | plain    | 
- f3     | text    |           |          |         | extended | 
+                          View "testviewschm2.aliased_view_1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ f1     | integer |           |                     |         | plain    | 
+ f2     | integer |           |                     |         | plain    | 
+ f3     | text    |           |                     |         | extended | 
 View definition:
  SELECT f1,
     f2,
@@ -777,12 +777,12 @@ View definition:
           WHERE tx1.f1 = tt1.x1));
 
 \d+ aliased_view_2
-                    View "testviewschm2.aliased_view_2"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- f1     | integer |           |          |         | plain    | 
- f2     | integer |           |          |         | plain    | 
- f3     | text    |           |          |         | extended | 
+                          View "testviewschm2.aliased_view_2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ f1     | integer |           |                     |         | plain    | 
+ f2     | integer |           |                     |         | plain    | 
+ f3     | text    |           |                     |         | extended | 
 View definition:
  SELECT f1,
     f2,
@@ -793,12 +793,12 @@ View definition:
           WHERE a1.f1 = tt1.x1));
 
 \d+ aliased_view_3
-                    View "testviewschm2.aliased_view_3"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- f1     | integer |           |          |         | plain    | 
- f2     | integer |           |          |         | plain    | 
- f3     | text    |           |          |         | extended | 
+                          View "testviewschm2.aliased_view_3"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ f1     | integer |           |                     |         | plain    | 
+ f2     | integer |           |                     |         | plain    | 
+ f3     | text    |           |                     |         | extended | 
 View definition:
  SELECT f1,
     f2,
@@ -809,12 +809,12 @@ View definition:
           WHERE tx1.f1 = a2.x1));
 
 \d+ aliased_view_4
-                    View "testviewschm2.aliased_view_4"
- Column |  Type   | Collation | Nullable | Default | Storage  | Description 
---------+---------+-----------+----------+---------+----------+-------------
- y1     | integer |           |          |         | plain    | 
- f2     | integer |           |          |         | plain    | 
- f3     | text    |           |          |         | extended | 
+                          View "testviewschm2.aliased_view_4"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------+-----------+---------------------+---------+----------+-------------
+ y1     | integer |           |                     |         | plain    | 
+ f2     | integer |           |                     |         | plain    | 
+ f3     | text    |           |                     |         | extended | 
 View definition:
  SELECT y1,
     f2,
@@ -830,17 +830,17 @@ select * from
   (select * from (tbl1 cross join tbl2) same) ss,
   (tbl3 cross join tbl4) same;
 \d+ view_of_joins
-                    View "testviewschm2.view_of_joins"
- Column |  Type   | Collation | Nullable | Default | Storage | Description 
---------+---------+-----------+----------+---------+---------+-------------
- a      | integer |           |          |         | plain   | 
- b      | integer |           |          |         | plain   | 
- c      | integer |           |          |         | plain   | 
- d      | integer |           |          |         | plain   | 
- e      | integer |           |          |         | plain   | 
- f      | integer |           |          |         | plain   | 
- g      | integer |           |          |         | plain   | 
- h      | integer |           |          |         | plain   | 
+                          View "testviewschm2.view_of_joins"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Description 
+--------+---------+-----------+---------------------+---------+---------+-------------
+ a      | integer |           |                     |         | plain   | 
+ b      | integer |           |                     |         | plain   | 
+ c      | integer |           |                     |         | plain   | 
+ d      | integer |           |                     |         | plain   | 
+ e      | integer |           |                     |         | plain   | 
+ f      | integer |           |                     |         | plain   | 
+ g      | integer |           |                     |         | plain   | 
+ h      | integer |           |                     |         | plain   | 
 View definition:
  SELECT ss.a,
     ss.b,
@@ -1826,10 +1826,10 @@ create table tt15v_log(o tt15v, n tt15v, incr bool);
 create rule updlog as on update to tt15v do also
   insert into tt15v_log values(old, new, row(old,old) < row(new,new));
 \d+ tt15v
-                             View "testviewschm2.tt15v"
- Column |      Type       | Collation | Nullable | Default | Storage  | Description 
---------+-----------------+-----------+----------+---------+----------+-------------
- row    | nestedcomposite |           |          |         | extended | 
+                                  View "testviewschm2.tt15v"
+ Column |      Type       | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+-----------------+-----------+---------------------+---------+----------+-------------
+ row    | nestedcomposite |           |                     |         | extended | 
 View definition:
  SELECT ROW(i.*::int8_tbl)::nestedcomposite AS "row"
    FROM int8_tbl i;
diff --git a/src/test/regress/expected/domain.out b/src/test/regress/expected/domain.out
index 11276063bb..f2df4ffc6a 100644
--- a/src/test/regress/expected/domain.out
+++ b/src/test/regress/expected/domain.out
@@ -316,10 +316,10 @@ explain (verbose, costs off)
 create rule silly as on delete to dcomptable do instead
   update dcomptable set d1.r = (d1).r - 1, d1.i = (d1).i + 1 where (d1).i > 0;
 \d+ dcomptable
-                                  Table "public.dcomptable"
- Column |   Type    | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+-----------+-----------+----------+---------+----------+--------------+-------------
- d1     | dcomptype |           |          |         | extended |              | 
+                                       Table "public.dcomptable"
+ Column |   Type    | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+-----------+-----------+---------------------+---------+----------+--------------+-------------
+ d1     | dcomptype |           |                     |         | extended |              | 
 Indexes:
     "dcomptable_d1_key" UNIQUE CONSTRAINT, btree (d1)
 Rules:
@@ -476,10 +476,10 @@ create rule silly as on delete to dcomptable do instead
   update dcomptable set d1[1].r = d1[1].r - 1, d1[1].i = d1[1].i + 1
     where d1[1].i > 0;
 \d+ dcomptable
-                                  Table "public.dcomptable"
- Column |    Type    | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+------------+-----------+----------+---------+----------+--------------+-------------
- d1     | dcomptypea |           |          |         | extended |              | 
+                                        Table "public.dcomptable"
+ Column |    Type    | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+------------+-----------+---------------------+---------+----------+--------------+-------------
+ d1     | dcomptypea |           |                     |         | extended |              | 
 Indexes:
     "dcomptable_d1_key" UNIQUE CONSTRAINT, btree (d1)
 Rules:
diff --git a/src/test/regress/expected/expressions.out b/src/test/regress/expected/expressions.out
index d2c6db1bd5..a0eb6e19df 100644
--- a/src/test/regress/expected/expressions.out
+++ b/src/test/regress/expected/expressions.out
@@ -127,15 +127,15 @@ create view numeric_view as
     f2, f2::numeric(16,4) as f2164, f2::numeric as f2n
   from numeric_tbl;
 \d+ numeric_view
-                           View "public.numeric_view"
- Column |     Type      | Collation | Nullable | Default | Storage | Description 
---------+---------------+-----------+----------+---------+---------+-------------
- f1     | numeric(18,3) |           |          |         | main    | 
- f1164  | numeric(16,4) |           |          |         | main    | 
- f1n    | numeric       |           |          |         | main    | 
- f2     | numeric       |           |          |         | main    | 
- f2164  | numeric(16,4) |           |          |         | main    | 
- f2n    | numeric       |           |          |         | main    | 
+                                 View "public.numeric_view"
+ Column |     Type      | Collation | NOT NULL Constraint | Default | Storage | Description 
+--------+---------------+-----------+---------------------+---------+---------+-------------
+ f1     | numeric(18,3) |           |                     |         | main    | 
+ f1164  | numeric(16,4) |           |                     |         | main    | 
+ f1n    | numeric       |           |                     |         | main    | 
+ f2     | numeric       |           |                     |         | main    | 
+ f2164  | numeric(16,4) |           |                     |         | main    | 
+ f2n    | numeric       |           |                     |         | main    | 
 View definition:
  SELECT f1,
     f1::numeric(16,4) AS f1164,
@@ -161,15 +161,15 @@ create view bpchar_view as
     f2, f2::character(14) as f214, f2::bpchar as f2n
   from bpchar_tbl;
 \d+ bpchar_view
-                            View "public.bpchar_view"
- Column |     Type      | Collation | Nullable | Default | Storage  | Description 
---------+---------------+-----------+----------+---------+----------+-------------
- f1     | character(16) |           |          |         | extended | 
- f114   | character(14) |           |          |         | extended | 
- f1n    | bpchar        |           |          |         | extended | 
- f2     | bpchar        |           |          |         | extended | 
- f214   | character(14) |           |          |         | extended | 
- f2n    | bpchar        |           |          |         | extended | 
+                                  View "public.bpchar_view"
+ Column |     Type      | Collation | NOT NULL Constraint | Default | Storage  | Description 
+--------+---------------+-----------+---------------------+---------+----------+-------------
+ f1     | character(16) |           |                     |         | extended | 
+ f114   | character(14) |           |                     |         | extended | 
+ f1n    | bpchar        |           |                     |         | extended | 
+ f2     | bpchar        |           |                     |         | extended | 
+ f214   | character(14) |           |                     |         | extended | 
+ f2n    | bpchar        |           |                     |         | extended | 
 View definition:
  SELECT f1,
     f1::character(14) AS f114,
diff --git a/src/test/regress/expected/foreign_data.out b/src/test/regress/expected/foreign_data.out
index e90f4f846b..811b2be752 100644
--- a/src/test/regress/expected/foreign_data.out
+++ b/src/test/regress/expected/foreign_data.out
@@ -733,12 +733,12 @@ CREATE FOREIGN TABLE ft1 (
 COMMENT ON FOREIGN TABLE ft1 IS 'ft1';
 COMMENT ON COLUMN ft1.c1 IS 'ft1.c1';
 \d+ ft1
-                                                 Foreign table "public.ft1"
- Column |  Type   | Collation | Nullable | Default |          FDW options           | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+--------------------------------+----------+--------------+-------------
- c1     | integer |           | not null |         | ("param 1" 'val1')             | plain    |              | ft1.c1
- c2     | text    |           |          |         | (param2 'val2', param3 'val3') | extended |              | 
- c3     | date    |           |          |         |                                | plain    |              | 
+                                                      Foreign table "public.ft1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default |          FDW options           | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+--------------------------------+----------+--------------+-------------
+ c1     | integer |           | ft1_c1_not_null     |         | ("param 1" 'val1')             | plain    |              | ft1.c1
+ c2     | text    |           |                     |         | (param2 'val2', param3 'val3') | extended |              | 
+ c3     | date    |           |                     |         |                                | plain    |              | 
 Check constraints:
     "ft1_c2_check" CHECK (c2 <> ''::text)
     "ft1_c3_check" CHECK (c3 >= '01-01-1994'::date AND c3 <= '01-31-1994'::date)
@@ -848,19 +848,19 @@ ALTER FOREIGN TABLE ft1 ALTER COLUMN c1 SET (n_distinct = 100);
 ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 SET STATISTICS -1;
 ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 SET STORAGE PLAIN;
 \d+ ft1
-                                                 Foreign table "public.ft1"
- Column |  Type   | Collation | Nullable | Default |          FDW options           | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+--------------------------------+----------+--------------+-------------
- c1     | integer |           | not null |         | ("param 1" 'val1')             | plain    | 10000        | 
- c2     | text    |           |          |         | (param2 'val2', param3 'val3') | extended |              | 
- c3     | date    |           |          |         |                                | plain    |              | 
- c4     | integer |           |          | 0       |                                | plain    |              | 
- c5     | integer |           |          |         |                                | plain    |              | 
- c6     | integer |           | not null |         |                                | plain    |              | 
- c7     | integer |           |          |         | (p1 'v1', p2 'v2')             | plain    |              | 
- c8     | text    |           |          |         | (p2 'V2')                      | plain    |              | 
- c9     | integer |           |          |         |                                | plain    |              | 
- c10    | integer |           |          |         | (p1 'v1')                      | plain    |              | 
+                                                      Foreign table "public.ft1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default |          FDW options           | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+--------------------------------+----------+--------------+-------------
+ c1     | integer |           | ft1_c1_not_null     |         | ("param 1" 'val1')             | plain    | 10000        | 
+ c2     | text    |           |                     |         | (param2 'val2', param3 'val3') | extended |              | 
+ c3     | date    |           |                     |         |                                | plain    |              | 
+ c4     | integer |           |                     | 0       |                                | plain    |              | 
+ c5     | integer |           |                     |         |                                | plain    |              | 
+ c6     | integer |           | ft1_c6_not_null     |         |                                | plain    |              | 
+ c7     | integer |           |                     |         | (p1 'v1', p2 'v2')             | plain    |              | 
+ c8     | text    |           |                     |         | (p2 'V2')                      | plain    |              | 
+ c9     | integer |           |                     |         |                                | plain    |              | 
+ c10    | integer |           |                     |         | (p1 'v1')                      | plain    |              | 
 Check constraints:
     "ft1_c2_check" CHECK (c2 <> ''::text)
     "ft1_c3_check" CHECK (c3 >= '01-01-1994'::date AND c3 <= '01-31-1994'::date)
@@ -1398,33 +1398,33 @@ CREATE TABLE fd_pt1 (
 CREATE FOREIGN TABLE ft2 () INHERITS (fd_pt1)
   SERVER s0 OPTIONS (delimiter ',', quote '"', "be quoted" 'value');
 \d+ fd_pt1
-                                   Table "public.fd_pt1"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- c1     | integer |           | not null |         | plain    |              | 
- c2     | text    |           |          |         | extended |              | 
- c3     | date    |           |          |         | plain    |              | 
+                                        Table "public.fd_pt1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ c1     | integer |           | fd_pt1_c1_not_null  |         | plain    |              | 
+ c2     | text    |           |                     |         | extended |              | 
+ c3     | date    |           |                     |         | plain    |              | 
 Child tables: ft2, FOREIGN
 
 \d+ ft2
-                                       Foreign table "public.ft2"
- Column |  Type   | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+-------------+----------+--------------+-------------
- c1     | integer |           | not null |         |             | plain    |              | 
- c2     | text    |           |          |         |             | extended |              | 
- c3     | date    |           |          |         |             | plain    |              | 
+                                             Foreign table "public.ft2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | FDW options | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+-------------+----------+--------------+-------------
+ c1     | integer |           | fd_pt1_c1_not_null  |         |             | plain    |              | 
+ c2     | text    |           |                     |         |             | extended |              | 
+ c3     | date    |           |                     |         |             | plain    |              | 
 Server: s0
 FDW options: (delimiter ',', quote '"', "be quoted" 'value')
 Inherits: fd_pt1
 
 DROP FOREIGN TABLE ft2;
 \d+ fd_pt1
-                                   Table "public.fd_pt1"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- c1     | integer |           | not null |         | plain    |              | 
- c2     | text    |           |          |         | extended |              | 
- c3     | date    |           |          |         | plain    |              | 
+                                        Table "public.fd_pt1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ c1     | integer |           | fd_pt1_c1_not_null  |         | plain    |              | 
+ c2     | text    |           |                     |         | extended |              | 
+ c3     | date    |           |                     |         | plain    |              | 
 
 CREATE FOREIGN TABLE ft2 (
 	c1 integer NOT NULL,
@@ -1432,32 +1432,32 @@ CREATE FOREIGN TABLE ft2 (
 	c3 date
 ) SERVER s0 OPTIONS (delimiter ',', quote '"', "be quoted" 'value');
 \d+ ft2
-                                       Foreign table "public.ft2"
- Column |  Type   | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+-------------+----------+--------------+-------------
- c1     | integer |           | not null |         |             | plain    |              | 
- c2     | text    |           |          |         |             | extended |              | 
- c3     | date    |           |          |         |             | plain    |              | 
+                                             Foreign table "public.ft2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | FDW options | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+-------------+----------+--------------+-------------
+ c1     | integer |           | ft2_c1_not_null     |         |             | plain    |              | 
+ c2     | text    |           |                     |         |             | extended |              | 
+ c3     | date    |           |                     |         |             | plain    |              | 
 Server: s0
 FDW options: (delimiter ',', quote '"', "be quoted" 'value')
 
 ALTER FOREIGN TABLE ft2 INHERIT fd_pt1;
 \d+ fd_pt1
-                                   Table "public.fd_pt1"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- c1     | integer |           | not null |         | plain    |              | 
- c2     | text    |           |          |         | extended |              | 
- c3     | date    |           |          |         | plain    |              | 
+                                        Table "public.fd_pt1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ c1     | integer |           | fd_pt1_c1_not_null  |         | plain    |              | 
+ c2     | text    |           |                     |         | extended |              | 
+ c3     | date    |           |                     |         | plain    |              | 
 Child tables: ft2, FOREIGN
 
 \d+ ft2
-                                       Foreign table "public.ft2"
- Column |  Type   | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+-------------+----------+--------------+-------------
- c1     | integer |           | not null |         |             | plain    |              | 
- c2     | text    |           |          |         |             | extended |              | 
- c3     | date    |           |          |         |             | plain    |              | 
+                                             Foreign table "public.ft2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | FDW options | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+-------------+----------+--------------+-------------
+ c1     | integer |           | ft2_c1_not_null     |         |             | plain    |              | 
+ c2     | text    |           |                     |         |             | extended |              | 
+ c3     | date    |           |                     |         |             | plain    |              | 
 Server: s0
 FDW options: (delimiter ',', quote '"', "be quoted" 'value')
 Inherits: fd_pt1
@@ -1473,12 +1473,12 @@ NOTICE:  merging column "c1" with inherited definition
 NOTICE:  merging column "c2" with inherited definition
 NOTICE:  merging column "c3" with inherited definition
 \d+ ft2
-                                       Foreign table "public.ft2"
- Column |  Type   | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+-------------+----------+--------------+-------------
- c1     | integer |           | not null |         |             | plain    |              | 
- c2     | text    |           |          |         |             | extended |              | 
- c3     | date    |           |          |         |             | plain    |              | 
+                                             Foreign table "public.ft2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | FDW options | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+-------------+----------+--------------+-------------
+ c1     | integer |           | ft2_c1_not_null     |         |             | plain    |              | 
+ c2     | text    |           |                     |         |             | extended |              | 
+ c3     | date    |           |                     |         |             | plain    |              | 
 Server: s0
 FDW options: (delimiter ',', quote '"', "be quoted" 'value')
 Inherits: fd_pt1
@@ -1486,21 +1486,21 @@ Child tables: ct3,
               ft3, FOREIGN
 
 \d+ ct3
-                                    Table "public.ct3"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- c1     | integer |           | not null |         | plain    |              | 
- c2     | text    |           |          |         | extended |              | 
- c3     | date    |           |          |         | plain    |              | 
+                                          Table "public.ct3"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ c1     | integer |           | ft2_c1_not_null     |         | plain    |              | 
+ c2     | text    |           |                     |         | extended |              | 
+ c3     | date    |           |                     |         | plain    |              | 
 Inherits: ft2
 
 \d+ ft3
-                                       Foreign table "public.ft3"
- Column |  Type   | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+-------------+----------+--------------+-------------
- c1     | integer |           | not null |         |             | plain    |              | 
- c2     | text    |           |          |         |             | extended |              | 
- c3     | date    |           |          |         |             | plain    |              | 
+                                             Foreign table "public.ft3"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | FDW options | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+-------------+----------+--------------+-------------
+ c1     | integer |           | ft3_c1_not_null     |         |             | plain    |              | 
+ c2     | text    |           |                     |         |             | extended |              | 
+ c3     | date    |           |                     |         |             | plain    |              | 
 Server: s0
 Inherits: ft2
 
@@ -1511,31 +1511,31 @@ ALTER TABLE fd_pt1 ADD COLUMN c6 integer;
 ALTER TABLE fd_pt1 ADD COLUMN c7 integer NOT NULL;
 ALTER TABLE fd_pt1 ADD COLUMN c8 integer;
 \d+ fd_pt1
-                                   Table "public.fd_pt1"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- c1     | integer |           | not null |         | plain    |              | 
- c2     | text    |           |          |         | extended |              | 
- c3     | date    |           |          |         | plain    |              | 
- c4     | integer |           |          |         | plain    |              | 
- c5     | integer |           |          | 0       | plain    |              | 
- c6     | integer |           |          |         | plain    |              | 
- c7     | integer |           | not null |         | plain    |              | 
- c8     | integer |           |          |         | plain    |              | 
+                                        Table "public.fd_pt1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ c1     | integer |           | fd_pt1_c1_not_null  |         | plain    |              | 
+ c2     | text    |           |                     |         | extended |              | 
+ c3     | date    |           |                     |         | plain    |              | 
+ c4     | integer |           |                     |         | plain    |              | 
+ c5     | integer |           |                     | 0       | plain    |              | 
+ c6     | integer |           |                     |         | plain    |              | 
+ c7     | integer |           | fd_pt1_c7_not_null  |         | plain    |              | 
+ c8     | integer |           |                     |         | plain    |              | 
 Child tables: ft2, FOREIGN
 
 \d+ ft2
-                                       Foreign table "public.ft2"
- Column |  Type   | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+-------------+----------+--------------+-------------
- c1     | integer |           | not null |         |             | plain    |              | 
- c2     | text    |           |          |         |             | extended |              | 
- c3     | date    |           |          |         |             | plain    |              | 
- c4     | integer |           |          |         |             | plain    |              | 
- c5     | integer |           |          | 0       |             | plain    |              | 
- c6     | integer |           |          |         |             | plain    |              | 
- c7     | integer |           | not null |         |             | plain    |              | 
- c8     | integer |           |          |         |             | plain    |              | 
+                                             Foreign table "public.ft2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | FDW options | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+-------------+----------+--------------+-------------
+ c1     | integer |           | ft2_c1_not_null     |         |             | plain    |              | 
+ c2     | text    |           |                     |         |             | extended |              | 
+ c3     | date    |           |                     |         |             | plain    |              | 
+ c4     | integer |           |                     |         |             | plain    |              | 
+ c5     | integer |           |                     | 0       |             | plain    |              | 
+ c6     | integer |           |                     |         |             | plain    |              | 
+ c7     | integer |           | fd_pt1_c7_not_null  |         |             | plain    |              | 
+ c8     | integer |           |                     |         |             | plain    |              | 
 Server: s0
 FDW options: (delimiter ',', quote '"', "be quoted" 'value')
 Inherits: fd_pt1
@@ -1543,31 +1543,31 @@ Child tables: ct3,
               ft3, FOREIGN
 
 \d+ ct3
-                                    Table "public.ct3"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- c1     | integer |           | not null |         | plain    |              | 
- c2     | text    |           |          |         | extended |              | 
- c3     | date    |           |          |         | plain    |              | 
- c4     | integer |           |          |         | plain    |              | 
- c5     | integer |           |          | 0       | plain    |              | 
- c6     | integer |           |          |         | plain    |              | 
- c7     | integer |           | not null |         | plain    |              | 
- c8     | integer |           |          |         | plain    |              | 
+                                          Table "public.ct3"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ c1     | integer |           | ft2_c1_not_null     |         | plain    |              | 
+ c2     | text    |           |                     |         | extended |              | 
+ c3     | date    |           |                     |         | plain    |              | 
+ c4     | integer |           |                     |         | plain    |              | 
+ c5     | integer |           |                     | 0       | plain    |              | 
+ c6     | integer |           |                     |         | plain    |              | 
+ c7     | integer |           | fd_pt1_c7_not_null  |         | plain    |              | 
+ c8     | integer |           |                     |         | plain    |              | 
 Inherits: ft2
 
 \d+ ft3
-                                       Foreign table "public.ft3"
- Column |  Type   | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+-------------+----------+--------------+-------------
- c1     | integer |           | not null |         |             | plain    |              | 
- c2     | text    |           |          |         |             | extended |              | 
- c3     | date    |           |          |         |             | plain    |              | 
- c4     | integer |           |          |         |             | plain    |              | 
- c5     | integer |           |          | 0       |             | plain    |              | 
- c6     | integer |           |          |         |             | plain    |              | 
- c7     | integer |           | not null |         |             | plain    |              | 
- c8     | integer |           |          |         |             | plain    |              | 
+                                             Foreign table "public.ft3"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | FDW options | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+-------------+----------+--------------+-------------
+ c1     | integer |           | ft3_c1_not_null     |         |             | plain    |              | 
+ c2     | text    |           |                     |         |             | extended |              | 
+ c3     | date    |           |                     |         |             | plain    |              | 
+ c4     | integer |           |                     |         |             | plain    |              | 
+ c5     | integer |           |                     | 0       |             | plain    |              | 
+ c6     | integer |           |                     |         |             | plain    |              | 
+ c7     | integer |           | fd_pt1_c7_not_null  |         |             | plain    |              | 
+ c8     | integer |           |                     |         |             | plain    |              | 
 Server: s0
 Inherits: ft2
 
@@ -1585,31 +1585,31 @@ ALTER TABLE fd_pt1 ALTER COLUMN c1 SET (n_distinct = 100);
 ALTER TABLE fd_pt1 ALTER COLUMN c8 SET STATISTICS -1;
 ALTER TABLE fd_pt1 ALTER COLUMN c8 SET STORAGE EXTERNAL;
 \d+ fd_pt1
-                                   Table "public.fd_pt1"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- c1     | integer |           | not null |         | plain    | 10000        | 
- c2     | text    |           |          |         | extended |              | 
- c3     | date    |           |          |         | plain    |              | 
- c4     | integer |           |          | 0       | plain    |              | 
- c5     | integer |           |          |         | plain    |              | 
- c6     | integer |           | not null |         | plain    |              | 
- c7     | integer |           |          |         | plain    |              | 
- c8     | text    |           |          |         | external |              | 
+                                        Table "public.fd_pt1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ c1     | integer |           | fd_pt1_c1_not_null  |         | plain    | 10000        | 
+ c2     | text    |           |                     |         | extended |              | 
+ c3     | date    |           |                     |         | plain    |              | 
+ c4     | integer |           |                     | 0       | plain    |              | 
+ c5     | integer |           |                     |         | plain    |              | 
+ c6     | integer |           | fd_pt1_c6_not_null  |         | plain    |              | 
+ c7     | integer |           |                     |         | plain    |              | 
+ c8     | text    |           |                     |         | external |              | 
 Child tables: ft2, FOREIGN
 
 \d+ ft2
-                                       Foreign table "public.ft2"
- Column |  Type   | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+-------------+----------+--------------+-------------
- c1     | integer |           | not null |         |             | plain    | 10000        | 
- c2     | text    |           |          |         |             | extended |              | 
- c3     | date    |           |          |         |             | plain    |              | 
- c4     | integer |           |          | 0       |             | plain    |              | 
- c5     | integer |           |          |         |             | plain    |              | 
- c6     | integer |           | not null |         |             | plain    |              | 
- c7     | integer |           |          |         |             | plain    |              | 
- c8     | text    |           |          |         |             | external |              | 
+                                             Foreign table "public.ft2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | FDW options | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+-------------+----------+--------------+-------------
+ c1     | integer |           | ft2_c1_not_null     |         |             | plain    | 10000        | 
+ c2     | text    |           |                     |         |             | extended |              | 
+ c3     | date    |           |                     |         |             | plain    |              | 
+ c4     | integer |           |                     | 0       |             | plain    |              | 
+ c5     | integer |           |                     |         |             | plain    |              | 
+ c6     | integer |           | fd_pt1_c6_not_null  |         |             | plain    |              | 
+ c7     | integer |           |                     |         |             | plain    |              | 
+ c8     | text    |           |                     |         |             | external |              | 
 Server: s0
 FDW options: (delimiter ',', quote '"', "be quoted" 'value')
 Inherits: fd_pt1
@@ -1623,21 +1623,21 @@ ALTER TABLE fd_pt1 DROP COLUMN c6;
 ALTER TABLE fd_pt1 DROP COLUMN c7;
 ALTER TABLE fd_pt1 DROP COLUMN c8;
 \d+ fd_pt1
-                                   Table "public.fd_pt1"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- c1     | integer |           | not null |         | plain    | 10000        | 
- c2     | text    |           |          |         | extended |              | 
- c3     | date    |           |          |         | plain    |              | 
+                                        Table "public.fd_pt1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ c1     | integer |           | fd_pt1_c1_not_null  |         | plain    | 10000        | 
+ c2     | text    |           |                     |         | extended |              | 
+ c3     | date    |           |                     |         | plain    |              | 
 Child tables: ft2, FOREIGN
 
 \d+ ft2
-                                       Foreign table "public.ft2"
- Column |  Type   | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+-------------+----------+--------------+-------------
- c1     | integer |           | not null |         |             | plain    | 10000        | 
- c2     | text    |           |          |         |             | extended |              | 
- c3     | date    |           |          |         |             | plain    |              | 
+                                             Foreign table "public.ft2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | FDW options | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+-------------+----------+--------------+-------------
+ c1     | integer |           | ft2_c1_not_null     |         |             | plain    | 10000        | 
+ c2     | text    |           |                     |         |             | extended |              | 
+ c3     | date    |           |                     |         |             | plain    |              | 
 Server: s0
 FDW options: (delimiter ',', quote '"', "be quoted" 'value')
 Inherits: fd_pt1
@@ -1661,24 +1661,24 @@ SELECT relname, conname, contype, conislocal, coninhcount, connoinherit
 
 -- child does not inherit NO INHERIT constraints
 \d+ fd_pt1
-                                   Table "public.fd_pt1"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- c1     | integer |           | not null |         | plain    | 10000        | 
- c2     | text    |           |          |         | extended |              | 
- c3     | date    |           |          |         | plain    |              | 
+                                        Table "public.fd_pt1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ c1     | integer |           | fd_pt1_c1_not_null  |         | plain    | 10000        | 
+ c2     | text    |           |                     |         | extended |              | 
+ c3     | date    |           |                     |         | plain    |              | 
 Check constraints:
     "fd_pt1chk1" CHECK (c1 > 0) NO INHERIT
     "fd_pt1chk2" CHECK (c2 <> ''::text)
 Child tables: ft2, FOREIGN
 
 \d+ ft2
-                                       Foreign table "public.ft2"
- Column |  Type   | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+-------------+----------+--------------+-------------
- c1     | integer |           | not null |         |             | plain    | 10000        | 
- c2     | text    |           |          |         |             | extended |              | 
- c3     | date    |           |          |         |             | plain    |              | 
+                                             Foreign table "public.ft2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | FDW options | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+-------------+----------+--------------+-------------
+ c1     | integer |           | ft2_c1_not_null     |         |             | plain    | 10000        | 
+ c2     | text    |           |                     |         |             | extended |              | 
+ c3     | date    |           |                     |         |             | plain    |              | 
 Check constraints:
     "fd_pt1chk2" CHECK (c2 <> ''::text)
 Server: s0
@@ -1708,24 +1708,24 @@ ALTER FOREIGN TABLE ft2 ADD CONSTRAINT fd_pt1chk2 CHECK (c2 <> '');
 ALTER FOREIGN TABLE ft2 INHERIT fd_pt1;
 -- child does not inherit NO INHERIT constraints
 \d+ fd_pt1
-                                   Table "public.fd_pt1"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- c1     | integer |           | not null |         | plain    | 10000        | 
- c2     | text    |           |          |         | extended |              | 
- c3     | date    |           |          |         | plain    |              | 
+                                        Table "public.fd_pt1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ c1     | integer |           | fd_pt1_c1_not_null  |         | plain    | 10000        | 
+ c2     | text    |           |                     |         | extended |              | 
+ c3     | date    |           |                     |         | plain    |              | 
 Check constraints:
     "fd_pt1chk1" CHECK (c1 > 0) NO INHERIT
     "fd_pt1chk2" CHECK (c2 <> ''::text)
 Child tables: ft2, FOREIGN
 
 \d+ ft2
-                                       Foreign table "public.ft2"
- Column |  Type   | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+-------------+----------+--------------+-------------
- c1     | integer |           | not null |         |             | plain    |              | 
- c2     | text    |           |          |         |             | extended |              | 
- c3     | date    |           |          |         |             | plain    |              | 
+                                             Foreign table "public.ft2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | FDW options | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+-------------+----------+--------------+-------------
+ c1     | integer |           | ft2_c1_not_null     |         |             | plain    |              | 
+ c2     | text    |           |                     |         |             | extended |              | 
+ c3     | date    |           |                     |         |             | plain    |              | 
 Check constraints:
     "fd_pt1chk2" CHECK (c2 <> ''::text)
 Server: s0
@@ -1739,23 +1739,23 @@ ALTER TABLE fd_pt1 DROP CONSTRAINT fd_pt1chk2 CASCADE;
 INSERT INTO fd_pt1 VALUES (1, 'fd_pt1'::text, '1994-01-01'::date);
 ALTER TABLE fd_pt1 ADD CONSTRAINT fd_pt1chk3 CHECK (c2 <> '') NOT VALID;
 \d+ fd_pt1
-                                   Table "public.fd_pt1"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- c1     | integer |           | not null |         | plain    | 10000        | 
- c2     | text    |           |          |         | extended |              | 
- c3     | date    |           |          |         | plain    |              | 
+                                        Table "public.fd_pt1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ c1     | integer |           | fd_pt1_c1_not_null  |         | plain    | 10000        | 
+ c2     | text    |           |                     |         | extended |              | 
+ c3     | date    |           |                     |         | plain    |              | 
 Check constraints:
     "fd_pt1chk3" CHECK (c2 <> ''::text) NOT VALID
 Child tables: ft2, FOREIGN
 
 \d+ ft2
-                                       Foreign table "public.ft2"
- Column |  Type   | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+-------------+----------+--------------+-------------
- c1     | integer |           | not null |         |             | plain    |              | 
- c2     | text    |           |          |         |             | extended |              | 
- c3     | date    |           |          |         |             | plain    |              | 
+                                             Foreign table "public.ft2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | FDW options | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+-------------+----------+--------------+-------------
+ c1     | integer |           | ft2_c1_not_null     |         |             | plain    |              | 
+ c2     | text    |           |                     |         |             | extended |              | 
+ c3     | date    |           |                     |         |             | plain    |              | 
 Check constraints:
     "fd_pt1chk2" CHECK (c2 <> ''::text)
     "fd_pt1chk3" CHECK (c2 <> ''::text) NOT VALID
@@ -1766,23 +1766,23 @@ Inherits: fd_pt1
 -- VALIDATE CONSTRAINT need do nothing on foreign tables
 ALTER TABLE fd_pt1 VALIDATE CONSTRAINT fd_pt1chk3;
 \d+ fd_pt1
-                                   Table "public.fd_pt1"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- c1     | integer |           | not null |         | plain    | 10000        | 
- c2     | text    |           |          |         | extended |              | 
- c3     | date    |           |          |         | plain    |              | 
+                                        Table "public.fd_pt1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ c1     | integer |           | fd_pt1_c1_not_null  |         | plain    | 10000        | 
+ c2     | text    |           |                     |         | extended |              | 
+ c3     | date    |           |                     |         | plain    |              | 
 Check constraints:
     "fd_pt1chk3" CHECK (c2 <> ''::text)
 Child tables: ft2, FOREIGN
 
 \d+ ft2
-                                       Foreign table "public.ft2"
- Column |  Type   | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+-------------+----------+--------------+-------------
- c1     | integer |           | not null |         |             | plain    |              | 
- c2     | text    |           |          |         |             | extended |              | 
- c3     | date    |           |          |         |             | plain    |              | 
+                                             Foreign table "public.ft2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | FDW options | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+-------------+----------+--------------+-------------
+ c1     | integer |           | ft2_c1_not_null     |         |             | plain    |              | 
+ c2     | text    |           |                     |         |             | extended |              | 
+ c3     | date    |           |                     |         |             | plain    |              | 
 Check constraints:
     "fd_pt1chk2" CHECK (c2 <> ''::text)
     "fd_pt1chk3" CHECK (c2 <> ''::text)
@@ -1797,23 +1797,23 @@ ALTER TABLE fd_pt1 RENAME COLUMN c3 TO f3;
 -- changes name of a constraint recursively
 ALTER TABLE fd_pt1 RENAME CONSTRAINT fd_pt1chk3 TO f2_check;
 \d+ fd_pt1
-                                   Table "public.fd_pt1"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- f1     | integer |           | not null |         | plain    | 10000        | 
- f2     | text    |           |          |         | extended |              | 
- f3     | date    |           |          |         | plain    |              | 
+                                        Table "public.fd_pt1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ f1     | integer |           | fd_pt1_c1_not_null  |         | plain    | 10000        | 
+ f2     | text    |           |                     |         | extended |              | 
+ f3     | date    |           |                     |         | plain    |              | 
 Check constraints:
     "f2_check" CHECK (f2 <> ''::text)
 Child tables: ft2, FOREIGN
 
 \d+ ft2
-                                       Foreign table "public.ft2"
- Column |  Type   | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+-------------+----------+--------------+-------------
- f1     | integer |           | not null |         |             | plain    |              | 
- f2     | text    |           |          |         |             | extended |              | 
- f3     | date    |           |          |         |             | plain    |              | 
+                                             Foreign table "public.ft2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | FDW options | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+-------------+----------+--------------+-------------
+ f1     | integer |           | ft2_c1_not_null     |         |             | plain    |              | 
+ f2     | text    |           |                     |         |             | extended |              | 
+ f3     | date    |           |                     |         |             | plain    |              | 
 Check constraints:
     "f2_check" CHECK (f2 <> ''::text)
     "fd_pt1chk2" CHECK (f2 <> ''::text)
@@ -1856,22 +1856,22 @@ CREATE TABLE fd_pt2 (
 CREATE FOREIGN TABLE fd_pt2_1 PARTITION OF fd_pt2 FOR VALUES IN (1)
   SERVER s0 OPTIONS (delimiter ',', quote '"', "be quoted" 'value');
 \d+ fd_pt2
-                             Partitioned table "public.fd_pt2"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- c1     | integer |           | not null |         | plain    |              | 
- c2     | text    |           |          |         | extended |              | 
- c3     | date    |           |          |         | plain    |              | 
+                                  Partitioned table "public.fd_pt2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ c1     | integer |           | fd_pt2_c1_not_null  |         | plain    |              | 
+ c2     | text    |           |                     |         | extended |              | 
+ c3     | date    |           |                     |         | plain    |              | 
 Partition key: LIST (c1)
 Partitions: fd_pt2_1 FOR VALUES IN (1), FOREIGN
 
 \d+ fd_pt2_1
-                                     Foreign table "public.fd_pt2_1"
- Column |  Type   | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+-------------+----------+--------------+-------------
- c1     | integer |           | not null |         |             | plain    |              | 
- c2     | text    |           |          |         |             | extended |              | 
- c3     | date    |           |          |         |             | plain    |              | 
+                                          Foreign table "public.fd_pt2_1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | FDW options | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+-------------+----------+--------------+-------------
+ c1     | integer |           | fd_pt2_c1_not_null  |         |             | plain    |              | 
+ c2     | text    |           |                     |         |             | extended |              | 
+ c3     | date    |           |                     |         |             | plain    |              | 
 Partition of: fd_pt2 FOR VALUES IN (1)
 Partition constraint: ((c1 IS NOT NULL) AND (c1 = 1))
 Server: s0
@@ -1886,13 +1886,13 @@ CREATE FOREIGN TABLE fd_pt2_1 (
 	c4 char
 ) SERVER s0 OPTIONS (delimiter ',', quote '"', "be quoted" 'value');
 \d+ fd_pt2_1
-                                       Foreign table "public.fd_pt2_1"
- Column |     Type     | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+--------------+-----------+----------+---------+-------------+----------+--------------+-------------
- c1     | integer      |           | not null |         |             | plain    |              | 
- c2     | text         |           |          |         |             | extended |              | 
- c3     | date         |           |          |         |             | plain    |              | 
- c4     | character(1) |           |          |         |             | extended |              | 
+                                             Foreign table "public.fd_pt2_1"
+ Column |     Type     | Collation | NOT NULL Constraint  | Default | FDW options | Storage  | Stats target | Description 
+--------+--------------+-----------+----------------------+---------+-------------+----------+--------------+-------------
+ c1     | integer      |           | fd_pt2_1_c1_not_null |         |             | plain    |              | 
+ c2     | text         |           |                      |         |             | extended |              | 
+ c3     | date         |           |                      |         |             | plain    |              | 
+ c4     | character(1) |           |                      |         |             | extended |              | 
 Server: s0
 FDW options: (delimiter ',', quote '"', "be quoted" 'value')
 
@@ -1901,12 +1901,12 @@ ERROR:  table "fd_pt2_1" contains column "c4" not found in parent "fd_pt2"
 DETAIL:  The new partition may contain only the columns present in parent.
 DROP FOREIGN TABLE fd_pt2_1;
 \d+ fd_pt2
-                             Partitioned table "public.fd_pt2"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- c1     | integer |           | not null |         | plain    |              | 
- c2     | text    |           |          |         | extended |              | 
- c3     | date    |           |          |         | plain    |              | 
+                                  Partitioned table "public.fd_pt2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ c1     | integer |           | fd_pt2_c1_not_null  |         | plain    |              | 
+ c2     | text    |           |                     |         | extended |              | 
+ c3     | date    |           |                     |         | plain    |              | 
 Partition key: LIST (c1)
 Number of partitions: 0
 
@@ -1916,34 +1916,34 @@ CREATE FOREIGN TABLE fd_pt2_1 (
 	c3 date
 ) SERVER s0 OPTIONS (delimiter ',', quote '"', "be quoted" 'value');
 \d+ fd_pt2_1
-                                     Foreign table "public.fd_pt2_1"
- Column |  Type   | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+-------------+----------+--------------+-------------
- c1     | integer |           | not null |         |             | plain    |              | 
- c2     | text    |           |          |         |             | extended |              | 
- c3     | date    |           |          |         |             | plain    |              | 
+                                           Foreign table "public.fd_pt2_1"
+ Column |  Type   | Collation | NOT NULL Constraint  | Default | FDW options | Storage  | Stats target | Description 
+--------+---------+-----------+----------------------+---------+-------------+----------+--------------+-------------
+ c1     | integer |           | fd_pt2_1_c1_not_null |         |             | plain    |              | 
+ c2     | text    |           |                      |         |             | extended |              | 
+ c3     | date    |           |                      |         |             | plain    |              | 
 Server: s0
 FDW options: (delimiter ',', quote '"', "be quoted" 'value')
 
 -- no attach partition validation occurs for foreign tables
 ALTER TABLE fd_pt2 ATTACH PARTITION fd_pt2_1 FOR VALUES IN (1);
 \d+ fd_pt2
-                             Partitioned table "public.fd_pt2"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- c1     | integer |           | not null |         | plain    |              | 
- c2     | text    |           |          |         | extended |              | 
- c3     | date    |           |          |         | plain    |              | 
+                                  Partitioned table "public.fd_pt2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ c1     | integer |           | fd_pt2_c1_not_null  |         | plain    |              | 
+ c2     | text    |           |                     |         | extended |              | 
+ c3     | date    |           |                     |         | plain    |              | 
 Partition key: LIST (c1)
 Partitions: fd_pt2_1 FOR VALUES IN (1), FOREIGN
 
 \d+ fd_pt2_1
-                                     Foreign table "public.fd_pt2_1"
- Column |  Type   | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+-------------+----------+--------------+-------------
- c1     | integer |           | not null |         |             | plain    |              | 
- c2     | text    |           |          |         |             | extended |              | 
- c3     | date    |           |          |         |             | plain    |              | 
+                                           Foreign table "public.fd_pt2_1"
+ Column |  Type   | Collation | NOT NULL Constraint  | Default | FDW options | Storage  | Stats target | Description 
+--------+---------+-----------+----------------------+---------+-------------+----------+--------------+-------------
+ c1     | integer |           | fd_pt2_1_c1_not_null |         |             | plain    |              | 
+ c2     | text    |           |                      |         |             | extended |              | 
+ c3     | date    |           |                      |         |             | plain    |              | 
 Partition of: fd_pt2 FOR VALUES IN (1)
 Partition constraint: ((c1 IS NOT NULL) AND (c1 = 1))
 Server: s0
@@ -1956,22 +1956,22 @@ ERROR:  cannot add column to a partition
 ALTER TABLE fd_pt2_1 ALTER c3 SET NOT NULL;
 ALTER TABLE fd_pt2_1 ADD CONSTRAINT p21chk CHECK (c2 <> '');
 \d+ fd_pt2
-                             Partitioned table "public.fd_pt2"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- c1     | integer |           | not null |         | plain    |              | 
- c2     | text    |           |          |         | extended |              | 
- c3     | date    |           |          |         | plain    |              | 
+                                  Partitioned table "public.fd_pt2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ c1     | integer |           | fd_pt2_c1_not_null  |         | plain    |              | 
+ c2     | text    |           |                     |         | extended |              | 
+ c3     | date    |           |                     |         | plain    |              | 
 Partition key: LIST (c1)
 Partitions: fd_pt2_1 FOR VALUES IN (1), FOREIGN
 
 \d+ fd_pt2_1
-                                     Foreign table "public.fd_pt2_1"
- Column |  Type   | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+-------------+----------+--------------+-------------
- c1     | integer |           | not null |         |             | plain    |              | 
- c2     | text    |           |          |         |             | extended |              | 
- c3     | date    |           | not null |         |             | plain    |              | 
+                                           Foreign table "public.fd_pt2_1"
+ Column |  Type   | Collation | NOT NULL Constraint  | Default | FDW options | Storage  | Stats target | Description 
+--------+---------+-----------+----------------------+---------+-------------+----------+--------------+-------------
+ c1     | integer |           | fd_pt2_1_c1_not_null |         |             | plain    |              | 
+ c2     | text    |           |                      |         |             | extended |              | 
+ c3     | date    |           | fd_pt2_1_c3_not_null |         |             | plain    |              | 
 Partition of: fd_pt2 FOR VALUES IN (1)
 Partition constraint: ((c1 IS NOT NULL) AND (c1 = 1))
 Check constraints:
@@ -1986,22 +1986,22 @@ ERROR:  column "c1" is marked NOT NULL in parent table
 ALTER TABLE fd_pt2 DETACH PARTITION fd_pt2_1;
 ALTER TABLE fd_pt2 ALTER c2 SET NOT NULL;
 \d+ fd_pt2
-                             Partitioned table "public.fd_pt2"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- c1     | integer |           | not null |         | plain    |              | 
- c2     | text    |           | not null |         | extended |              | 
- c3     | date    |           |          |         | plain    |              | 
+                                  Partitioned table "public.fd_pt2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ c1     | integer |           | fd_pt2_c1_not_null  |         | plain    |              | 
+ c2     | text    |           | fd_pt2_c2_not_null  |         | extended |              | 
+ c3     | date    |           |                     |         | plain    |              | 
 Partition key: LIST (c1)
 Number of partitions: 0
 
 \d+ fd_pt2_1
-                                     Foreign table "public.fd_pt2_1"
- Column |  Type   | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+-------------+----------+--------------+-------------
- c1     | integer |           | not null |         |             | plain    |              | 
- c2     | text    |           |          |         |             | extended |              | 
- c3     | date    |           | not null |         |             | plain    |              | 
+                                           Foreign table "public.fd_pt2_1"
+ Column |  Type   | Collation | NOT NULL Constraint  | Default | FDW options | Storage  | Stats target | Description 
+--------+---------+-----------+----------------------+---------+-------------+----------+--------------+-------------
+ c1     | integer |           | fd_pt2_1_c1_not_null |         |             | plain    |              | 
+ c2     | text    |           |                      |         |             | extended |              | 
+ c3     | date    |           | fd_pt2_1_c3_not_null |         |             | plain    |              | 
 Check constraints:
     "p21chk" CHECK (c2 <> ''::text)
 Server: s0
@@ -2014,24 +2014,24 @@ ALTER TABLE fd_pt2 ATTACH PARTITION fd_pt2_1 FOR VALUES IN (1);
 ALTER TABLE fd_pt2 DETACH PARTITION fd_pt2_1;
 ALTER TABLE fd_pt2 ADD CONSTRAINT fd_pt2chk1 CHECK (c1 > 0);
 \d+ fd_pt2
-                             Partitioned table "public.fd_pt2"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- c1     | integer |           | not null |         | plain    |              | 
- c2     | text    |           | not null |         | extended |              | 
- c3     | date    |           |          |         | plain    |              | 
+                                  Partitioned table "public.fd_pt2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ c1     | integer |           | fd_pt2_c1_not_null  |         | plain    |              | 
+ c2     | text    |           | fd_pt2_c2_not_null  |         | extended |              | 
+ c3     | date    |           |                     |         | plain    |              | 
 Partition key: LIST (c1)
 Check constraints:
     "fd_pt2chk1" CHECK (c1 > 0)
 Number of partitions: 0
 
 \d+ fd_pt2_1
-                                     Foreign table "public.fd_pt2_1"
- Column |  Type   | Collation | Nullable | Default | FDW options | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+-------------+----------+--------------+-------------
- c1     | integer |           | not null |         |             | plain    |              | 
- c2     | text    |           | not null |         |             | extended |              | 
- c3     | date    |           | not null |         |             | plain    |              | 
+                                           Foreign table "public.fd_pt2_1"
+ Column |  Type   | Collation | NOT NULL Constraint  | Default | FDW options | Storage  | Stats target | Description 
+--------+---------+-----------+----------------------+---------+-------------+----------+--------------+-------------
+ c1     | integer |           | fd_pt2_1_c1_not_null |         |             | plain    |              | 
+ c2     | text    |           | fd_pt2_1_c2_not_null |         |             | extended |              | 
+ c3     | date    |           | fd_pt2_1_c3_not_null |         |             | plain    |              | 
 Check constraints:
     "p21chk" CHECK (c2 <> ''::text)
 Server: s0
diff --git a/src/test/regress/expected/generated.out b/src/test/regress/expected/generated.out
index 702774d644..cbffc51aa0 100644
--- a/src/test/regress/expected/generated.out
+++ b/src/test/regress/expected/generated.out
@@ -309,12 +309,12 @@ ERROR:  column "b" inherits from generated column but specifies identity
 CREATE TABLE gtestx (x int, b int GENERATED ALWAYS AS (a * 22) STORED) INHERITS (gtest1);  -- ok, overrides parent
 NOTICE:  merging column "b" with inherited definition
 \d+ gtestx
-                                                Table "public.gtestx"
- Column |  Type   | Collation | Nullable |               Default               | Storage | Stats target | Description 
---------+---------+-----------+----------+-------------------------------------+---------+--------------+-------------
- a      | integer |           | not null |                                     | plain   |              | 
- b      | integer |           |          | generated always as (a * 22) stored | plain   |              | 
- x      | integer |           |          |                                     | plain   |              | 
+                                                      Table "public.gtestx"
+ Column |  Type   | Collation | NOT NULL Constraint |               Default               | Storage | Stats target | Description 
+--------+---------+-----------+---------------------+-------------------------------------+---------+--------------+-------------
+ a      | integer |           | gtestx_a_not_null   |                                     | plain   |              | 
+ b      | integer |           |                     | generated always as (a * 22) stored | plain   |              | 
+ x      | integer |           |                     |                                     | plain   |              | 
 Inherits: gtest1
 
 CREATE TABLE gtestxx_1 (a int NOT NULL, b int);
diff --git a/src/test/regress/expected/identity.out b/src/test/regress/expected/identity.out
index 5f03d8e14f..d9efe01298 100644
--- a/src/test/regress/expected/identity.out
+++ b/src/test/regress/expected/identity.out
@@ -498,14 +498,14 @@ TABLE itest8;
 (2 rows)
 
 \d+ itest8
-                                               Table "public.itest8"
- Column |  Type   | Collation | Nullable |             Default              | Storage | Stats target | Description 
---------+---------+-----------+----------+----------------------------------+---------+--------------+-------------
- f1     | integer |           |          |                                  | plain   |              | 
- f2     | integer |           | not null | generated always as identity     | plain   |              | 
- f3     | integer |           | not null | generated by default as identity | plain   |              | 
- f4     | bigint  |           | not null | generated always as identity     | plain   |              | 
- f5     | bigint  |           |          |                                  | plain   |              | 
+                                                    Table "public.itest8"
+ Column |  Type   | Collation | NOT NULL Constraint |             Default              | Storage | Stats target | Description 
+--------+---------+-----------+---------------------+----------------------------------+---------+--------------+-------------
+ f1     | integer |           |                     |                                  | plain   |              | 
+ f2     | integer |           | itest8_f2_not_null  | generated always as identity     | plain   |              | 
+ f3     | integer |           | itest8_f3_not_null  | generated by default as identity | plain   |              | 
+ f4     | bigint  |           | itest8_f4_not_null  | generated always as identity     | plain   |              | 
+ f5     | bigint  |           |                     |                                  | plain   |              | 
 
 \d itest8_f2_seq
                    Sequence "public.itest8_f2_seq"
diff --git a/src/test/regress/expected/inherit.out b/src/test/regress/expected/inherit.out
index 4777499c21..bf402fe291 100644
--- a/src/test/regress/expected/inherit.out
+++ b/src/test/regress/expected/inherit.out
@@ -1059,13 +1059,13 @@ ALTER TABLE inhts RENAME aa TO aaa;      -- to be failed
 ERROR:  cannot rename inherited column "aa"
 ALTER TABLE inhts RENAME d TO dd;
 \d+ inhts
-                                   Table "public.inhts"
- Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
---------+---------+-----------+----------+---------+---------+--------------+-------------
- aa     | integer |           |          |         | plain   |              | 
- b      | integer |           |          |         | plain   |              | 
- c      | integer |           |          |         | plain   |              | 
- dd     | integer |           |          |         | plain   |              | 
+                                        Table "public.inhts"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ aa     | integer |           |                     |         | plain   |              | 
+ b      | integer |           |                     |         | plain   |              | 
+ c      | integer |           |                     |         | plain   |              | 
+ dd     | integer |           |                     |         | plain   |              | 
 Inherits: inht1,
           inhs1
 
@@ -1078,14 +1078,14 @@ NOTICE:  merging multiple inherited definitions of column "aa"
 NOTICE:  merging multiple inherited definitions of column "b"
 ALTER TABLE inht1 RENAME aa TO aaa;
 \d+ inht4
-                                   Table "public.inht4"
- Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
---------+---------+-----------+----------+---------+---------+--------------+-------------
- aaa    | integer |           |          |         | plain   |              | 
- b      | integer |           |          |         | plain   |              | 
- x      | integer |           |          |         | plain   |              | 
- y      | integer |           |          |         | plain   |              | 
- z      | integer |           |          |         | plain   |              | 
+                                        Table "public.inht4"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ aaa    | integer |           |                     |         | plain   |              | 
+ b      | integer |           |                     |         | plain   |              | 
+ x      | integer |           |                     |         | plain   |              | 
+ y      | integer |           |                     |         | plain   |              | 
+ z      | integer |           |                     |         | plain   |              | 
 Inherits: inht2,
           inht3
 
@@ -1095,14 +1095,14 @@ ALTER TABLE inht1 RENAME aaa TO aaaa;
 ALTER TABLE inht1 RENAME b TO bb;                -- to be failed
 ERROR:  cannot rename inherited column "b"
 \d+ inhts
-                                   Table "public.inhts"
- Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
---------+---------+-----------+----------+---------+---------+--------------+-------------
- aaaa   | integer |           |          |         | plain   |              | 
- b      | integer |           |          |         | plain   |              | 
- x      | integer |           |          |         | plain   |              | 
- c      | integer |           |          |         | plain   |              | 
- d      | integer |           |          |         | plain   |              | 
+                                        Table "public.inhts"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ aaaa   | integer |           |                     |         | plain   |              | 
+ b      | integer |           |                     |         | plain   |              | 
+ x      | integer |           |                     |         | plain   |              | 
+ c      | integer |           |                     |         | plain   |              | 
+ d      | integer |           |                     |         | plain   |              | 
 Inherits: inht2,
           inhs1
 
@@ -1142,33 +1142,33 @@ drop cascades to table inht4
 CREATE TABLE test_constraints (id int, val1 varchar, val2 int, UNIQUE(val1, val2));
 CREATE TABLE test_constraints_inh () INHERITS (test_constraints);
 \d+ test_constraints
-                                   Table "public.test_constraints"
- Column |       Type        | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+-------------------+-----------+----------+---------+----------+--------------+-------------
- id     | integer           |           |          |         | plain    |              | 
- val1   | character varying |           |          |         | extended |              | 
- val2   | integer           |           |          |         | plain    |              | 
+                                        Table "public.test_constraints"
+ Column |       Type        | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+-------------------+-----------+---------------------+---------+----------+--------------+-------------
+ id     | integer           |           |                     |         | plain    |              | 
+ val1   | character varying |           |                     |         | extended |              | 
+ val2   | integer           |           |                     |         | plain    |              | 
 Indexes:
     "test_constraints_val1_val2_key" UNIQUE CONSTRAINT, btree (val1, val2)
 Child tables: test_constraints_inh
 
 ALTER TABLE ONLY test_constraints DROP CONSTRAINT test_constraints_val1_val2_key;
 \d+ test_constraints
-                                   Table "public.test_constraints"
- Column |       Type        | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+-------------------+-----------+----------+---------+----------+--------------+-------------
- id     | integer           |           |          |         | plain    |              | 
- val1   | character varying |           |          |         | extended |              | 
- val2   | integer           |           |          |         | plain    |              | 
+                                        Table "public.test_constraints"
+ Column |       Type        | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+-------------------+-----------+---------------------+---------+----------+--------------+-------------
+ id     | integer           |           |                     |         | plain    |              | 
+ val1   | character varying |           |                     |         | extended |              | 
+ val2   | integer           |           |                     |         | plain    |              | 
 Child tables: test_constraints_inh
 
 \d+ test_constraints_inh
-                                 Table "public.test_constraints_inh"
- Column |       Type        | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+-------------------+-----------+----------+---------+----------+--------------+-------------
- id     | integer           |           |          |         | plain    |              | 
- val1   | character varying |           |          |         | extended |              | 
- val2   | integer           |           |          |         | plain    |              | 
+                                      Table "public.test_constraints_inh"
+ Column |       Type        | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+-------------------+-----------+---------------------+---------+----------+--------------+-------------
+ id     | integer           |           |                     |         | plain    |              | 
+ val1   | character varying |           |                     |         | extended |              | 
+ val2   | integer           |           |                     |         | plain    |              | 
 Inherits: test_constraints
 
 DROP TABLE test_constraints_inh;
@@ -1179,27 +1179,27 @@ CREATE TABLE test_ex_constraints (
 );
 CREATE TABLE test_ex_constraints_inh () INHERITS (test_ex_constraints);
 \d+ test_ex_constraints
-                           Table "public.test_ex_constraints"
- Column |  Type  | Collation | Nullable | Default | Storage | Stats target | Description 
---------+--------+-----------+----------+---------+---------+--------------+-------------
- c      | circle |           |          |         | plain   |              | 
+                                 Table "public.test_ex_constraints"
+ Column |  Type  | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+--------+-----------+---------------------+---------+---------+--------------+-------------
+ c      | circle |           |                     |         | plain   |              | 
 Indexes:
     "test_ex_constraints_c_excl" EXCLUDE USING gist (c WITH &&)
 Child tables: test_ex_constraints_inh
 
 ALTER TABLE test_ex_constraints DROP CONSTRAINT test_ex_constraints_c_excl;
 \d+ test_ex_constraints
-                           Table "public.test_ex_constraints"
- Column |  Type  | Collation | Nullable | Default | Storage | Stats target | Description 
---------+--------+-----------+----------+---------+---------+--------------+-------------
- c      | circle |           |          |         | plain   |              | 
+                                 Table "public.test_ex_constraints"
+ Column |  Type  | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+--------+-----------+---------------------+---------+---------+--------------+-------------
+ c      | circle |           |                     |         | plain   |              | 
 Child tables: test_ex_constraints_inh
 
 \d+ test_ex_constraints_inh
-                         Table "public.test_ex_constraints_inh"
- Column |  Type  | Collation | Nullable | Default | Storage | Stats target | Description 
---------+--------+-----------+----------+---------+---------+--------------+-------------
- c      | circle |           |          |         | plain   |              | 
+                               Table "public.test_ex_constraints_inh"
+ Column |  Type  | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+--------+-----------+---------------------+---------+---------+--------------+-------------
+ c      | circle |           |                     |         | plain   |              | 
 Inherits: test_ex_constraints
 
 DROP TABLE test_ex_constraints_inh;
@@ -1209,37 +1209,37 @@ CREATE TABLE test_primary_constraints(id int PRIMARY KEY);
 CREATE TABLE test_foreign_constraints(id1 int REFERENCES test_primary_constraints(id));
 CREATE TABLE test_foreign_constraints_inh () INHERITS (test_foreign_constraints);
 \d+ test_primary_constraints
-                         Table "public.test_primary_constraints"
- Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
---------+---------+-----------+----------+---------+---------+--------------+-------------
- id     | integer |           | not null |         | plain   |              | 
+                               Table "public.test_primary_constraints"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ id     | integer |           | (primary key)       |         | plain   |              | 
 Indexes:
     "test_primary_constraints_pkey" PRIMARY KEY, btree (id)
 Referenced by:
     TABLE "test_foreign_constraints" CONSTRAINT "test_foreign_constraints_id1_fkey" FOREIGN KEY (id1) REFERENCES test_primary_constraints(id)
 
 \d+ test_foreign_constraints
-                         Table "public.test_foreign_constraints"
- Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
---------+---------+-----------+----------+---------+---------+--------------+-------------
- id1    | integer |           |          |         | plain   |              | 
+                               Table "public.test_foreign_constraints"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ id1    | integer |           |                     |         | plain   |              | 
 Foreign-key constraints:
     "test_foreign_constraints_id1_fkey" FOREIGN KEY (id1) REFERENCES test_primary_constraints(id)
 Child tables: test_foreign_constraints_inh
 
 ALTER TABLE test_foreign_constraints DROP CONSTRAINT test_foreign_constraints_id1_fkey;
 \d+ test_foreign_constraints
-                         Table "public.test_foreign_constraints"
- Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
---------+---------+-----------+----------+---------+---------+--------------+-------------
- id1    | integer |           |          |         | plain   |              | 
+                               Table "public.test_foreign_constraints"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ id1    | integer |           |                     |         | plain   |              | 
 Child tables: test_foreign_constraints_inh
 
 \d+ test_foreign_constraints_inh
-                       Table "public.test_foreign_constraints_inh"
- Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
---------+---------+-----------+----------+---------+---------+--------------+-------------
- id1    | integer |           |          |         | plain   |              | 
+                             Table "public.test_foreign_constraints_inh"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ id1    | integer |           |                     |         | plain   |              | 
 Inherits: test_foreign_constraints
 
 DROP TABLE test_foreign_constraints_inh;
diff --git a/src/test/regress/expected/insert.out b/src/test/regress/expected/insert.out
index dd4354fc7d..7633486814 100644
--- a/src/test/regress/expected/insert.out
+++ b/src/test/regress/expected/insert.out
@@ -163,11 +163,11 @@ create rule irule3 as on insert to inserttest2 do also
   insert into inserttest (f4[1].if1, f4[1].if2[2])
   select new.f1, new.f2;
 \d+ inserttest2
-                                Table "public.inserttest2"
- Column |  Type  | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+--------+-----------+----------+---------+----------+--------------+-------------
- f1     | bigint |           |          |         | plain    |              | 
- f2     | text   |           |          |         | extended |              | 
+                                     Table "public.inserttest2"
+ Column |  Type  | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+--------+-----------+---------------------+---------+----------+--------------+-------------
+ f1     | bigint |           |                     |         | plain    |              | 
+ f2     | text   |           |                     |         | extended |              | 
 Rules:
     irule1 AS
     ON INSERT TO inserttest2 DO  INSERT INTO inserttest (f3.if2[1], f3.if2[2])
@@ -447,11 +447,11 @@ from hash_parted order by part;
 -- test \d+ output on a table which has both partitioned and unpartitioned
 -- partitions
 \d+ list_parted
-                          Partitioned table "public.list_parted"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- a      | text    |           |          |         | extended |              | 
- b      | integer |           |          |         | plain    |              | 
+                                Partitioned table "public.list_parted"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ a      | text    |           |                     |         | extended |              | 
+ b      | integer |           |                     |         | plain    |              | 
 Partition key: LIST (lower(a))
 Partitions: part_aa_bb FOR VALUES IN ('aa', 'bb'),
             part_cc_dd FOR VALUES IN ('cc', 'dd'),
@@ -469,10 +469,10 @@ drop table hash_parted;
 create table list_parted (a int) partition by list (a);
 create table part_default partition of list_parted default;
 \d+ part_default
-                               Table "public.part_default"
- Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
---------+---------+-----------+----------+---------+---------+--------------+-------------
- a      | integer |           |          |         | plain   |              | 
+                                     Table "public.part_default"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ a      | integer |           |                     |         | plain   |              | 
 Partition of: list_parted DEFAULT
 No partition constraint
 
@@ -852,11 +852,11 @@ create table mcrparted6_common_ge_10 partition of mcrparted for values from ('co
 create table mcrparted7_gt_common_lt_d partition of mcrparted for values from ('common', maxvalue) to ('d', minvalue);
 create table mcrparted8_ge_d partition of mcrparted for values from ('d', minvalue) to (maxvalue, maxvalue);
 \d+ mcrparted
-                           Partitioned table "public.mcrparted"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- a      | text    |           |          |         | extended |              | 
- b      | integer |           |          |         | plain    |              | 
+                                 Partitioned table "public.mcrparted"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ a      | text    |           |                     |         | extended |              | 
+ b      | integer |           |                     |         | plain    |              | 
 Partition key: RANGE (a, b)
 Partitions: mcrparted1_lt_b FOR VALUES FROM (MINVALUE, MINVALUE) TO ('b', MINVALUE),
             mcrparted2_b FOR VALUES FROM ('b', MINVALUE) TO ('c', MINVALUE),
@@ -868,74 +868,74 @@ Partitions: mcrparted1_lt_b FOR VALUES FROM (MINVALUE, MINVALUE) TO ('b', MINVAL
             mcrparted8_ge_d FOR VALUES FROM ('d', MINVALUE) TO (MAXVALUE, MAXVALUE)
 
 \d+ mcrparted1_lt_b
-                              Table "public.mcrparted1_lt_b"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- a      | text    |           |          |         | extended |              | 
- b      | integer |           |          |         | plain    |              | 
+                                    Table "public.mcrparted1_lt_b"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ a      | text    |           |                     |         | extended |              | 
+ b      | integer |           |                     |         | plain    |              | 
 Partition of: mcrparted FOR VALUES FROM (MINVALUE, MINVALUE) TO ('b', MINVALUE)
 Partition constraint: ((a IS NOT NULL) AND (b IS NOT NULL) AND (a < 'b'::text))
 
 \d+ mcrparted2_b
-                                Table "public.mcrparted2_b"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- a      | text    |           |          |         | extended |              | 
- b      | integer |           |          |         | plain    |              | 
+                                     Table "public.mcrparted2_b"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ a      | text    |           |                     |         | extended |              | 
+ b      | integer |           |                     |         | plain    |              | 
 Partition of: mcrparted FOR VALUES FROM ('b', MINVALUE) TO ('c', MINVALUE)
 Partition constraint: ((a IS NOT NULL) AND (b IS NOT NULL) AND (a >= 'b'::text) AND (a < 'c'::text))
 
 \d+ mcrparted3_c_to_common
-                           Table "public.mcrparted3_c_to_common"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- a      | text    |           |          |         | extended |              | 
- b      | integer |           |          |         | plain    |              | 
+                                Table "public.mcrparted3_c_to_common"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ a      | text    |           |                     |         | extended |              | 
+ b      | integer |           |                     |         | plain    |              | 
 Partition of: mcrparted FOR VALUES FROM ('c', MINVALUE) TO ('common', MINVALUE)
 Partition constraint: ((a IS NOT NULL) AND (b IS NOT NULL) AND (a >= 'c'::text) AND (a < 'common'::text))
 
 \d+ mcrparted4_common_lt_0
-                           Table "public.mcrparted4_common_lt_0"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- a      | text    |           |          |         | extended |              | 
- b      | integer |           |          |         | plain    |              | 
+                                Table "public.mcrparted4_common_lt_0"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ a      | text    |           |                     |         | extended |              | 
+ b      | integer |           |                     |         | plain    |              | 
 Partition of: mcrparted FOR VALUES FROM ('common', MINVALUE) TO ('common', 0)
 Partition constraint: ((a IS NOT NULL) AND (b IS NOT NULL) AND (a = 'common'::text) AND (b < 0))
 
 \d+ mcrparted5_common_0_to_10
-                         Table "public.mcrparted5_common_0_to_10"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- a      | text    |           |          |         | extended |              | 
- b      | integer |           |          |         | plain    |              | 
+                               Table "public.mcrparted5_common_0_to_10"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ a      | text    |           |                     |         | extended |              | 
+ b      | integer |           |                     |         | plain    |              | 
 Partition of: mcrparted FOR VALUES FROM ('common', 0) TO ('common', 10)
 Partition constraint: ((a IS NOT NULL) AND (b IS NOT NULL) AND (a = 'common'::text) AND (b >= 0) AND (b < 10))
 
 \d+ mcrparted6_common_ge_10
-                          Table "public.mcrparted6_common_ge_10"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- a      | text    |           |          |         | extended |              | 
- b      | integer |           |          |         | plain    |              | 
+                                Table "public.mcrparted6_common_ge_10"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ a      | text    |           |                     |         | extended |              | 
+ b      | integer |           |                     |         | plain    |              | 
 Partition of: mcrparted FOR VALUES FROM ('common', 10) TO ('common', MAXVALUE)
 Partition constraint: ((a IS NOT NULL) AND (b IS NOT NULL) AND (a = 'common'::text) AND (b >= 10))
 
 \d+ mcrparted7_gt_common_lt_d
-                         Table "public.mcrparted7_gt_common_lt_d"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- a      | text    |           |          |         | extended |              | 
- b      | integer |           |          |         | plain    |              | 
+                               Table "public.mcrparted7_gt_common_lt_d"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ a      | text    |           |                     |         | extended |              | 
+ b      | integer |           |                     |         | plain    |              | 
 Partition of: mcrparted FOR VALUES FROM ('common', MAXVALUE) TO ('d', MINVALUE)
 Partition constraint: ((a IS NOT NULL) AND (b IS NOT NULL) AND (a > 'common'::text) AND (a < 'd'::text))
 
 \d+ mcrparted8_ge_d
-                              Table "public.mcrparted8_ge_d"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- a      | text    |           |          |         | extended |              | 
- b      | integer |           |          |         | plain    |              | 
+                                    Table "public.mcrparted8_ge_d"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ a      | text    |           |                     |         | extended |              | 
+ b      | integer |           |                     |         | plain    |              | 
 Partition of: mcrparted FOR VALUES FROM ('d', MINVALUE) TO (MAXVALUE, MAXVALUE)
 Partition constraint: ((a IS NOT NULL) AND (b IS NOT NULL) AND (a >= 'd'::text))
 
diff --git a/src/test/regress/expected/limit.out b/src/test/regress/expected/limit.out
index a2cd0f9f5b..3ba4ea6656 100644
--- a/src/test/regress/expected/limit.out
+++ b/src/test/regress/expected/limit.out
@@ -633,10 +633,10 @@ ERROR:  WITH TIES cannot be specified without ORDER BY clause
 CREATE VIEW limit_thousand_v_1 AS SELECT thousand FROM onek WHERE thousand < 995
 		ORDER BY thousand FETCH FIRST 5 ROWS WITH TIES OFFSET 10;
 \d+ limit_thousand_v_1
-                      View "public.limit_thousand_v_1"
-  Column  |  Type   | Collation | Nullable | Default | Storage | Description 
-----------+---------+-----------+----------+---------+---------+-------------
- thousand | integer |           |          |         | plain   | 
+                            View "public.limit_thousand_v_1"
+  Column  |  Type   | Collation | NOT NULL Constraint | Default | Storage | Description 
+----------+---------+-----------+---------------------+---------+---------+-------------
+ thousand | integer |           |                     |         | plain   | 
 View definition:
  SELECT thousand
    FROM onek
@@ -648,10 +648,10 @@ View definition:
 CREATE VIEW limit_thousand_v_2 AS SELECT thousand FROM onek WHERE thousand < 995
 		ORDER BY thousand OFFSET 10 FETCH FIRST 5 ROWS ONLY;
 \d+ limit_thousand_v_2
-                      View "public.limit_thousand_v_2"
-  Column  |  Type   | Collation | Nullable | Default | Storage | Description 
-----------+---------+-----------+----------+---------+---------+-------------
- thousand | integer |           |          |         | plain   | 
+                            View "public.limit_thousand_v_2"
+  Column  |  Type   | Collation | NOT NULL Constraint | Default | Storage | Description 
+----------+---------+-----------+---------------------+---------+---------+-------------
+ thousand | integer |           |                     |         | plain   | 
 View definition:
  SELECT thousand
    FROM onek
@@ -666,10 +666,10 @@ ERROR:  row count cannot be null in FETCH FIRST ... WITH TIES clause
 CREATE VIEW limit_thousand_v_3 AS SELECT thousand FROM onek WHERE thousand < 995
 		ORDER BY thousand FETCH FIRST (NULL+1) ROWS WITH TIES;
 \d+ limit_thousand_v_3
-                      View "public.limit_thousand_v_3"
-  Column  |  Type   | Collation | Nullable | Default | Storage | Description 
-----------+---------+-----------+----------+---------+---------+-------------
- thousand | integer |           |          |         | plain   | 
+                            View "public.limit_thousand_v_3"
+  Column  |  Type   | Collation | NOT NULL Constraint | Default | Storage | Description 
+----------+---------+-----------+---------------------+---------+---------+-------------
+ thousand | integer |           |                     |         | plain   | 
 View definition:
  SELECT thousand
    FROM onek
@@ -680,10 +680,10 @@ View definition:
 CREATE VIEW limit_thousand_v_4 AS SELECT thousand FROM onek WHERE thousand < 995
 		ORDER BY thousand FETCH FIRST NULL ROWS ONLY;
 \d+ limit_thousand_v_4
-                      View "public.limit_thousand_v_4"
-  Column  |  Type   | Collation | Nullable | Default | Storage | Description 
-----------+---------+-----------+----------+---------+---------+-------------
- thousand | integer |           |          |         | plain   | 
+                            View "public.limit_thousand_v_4"
+  Column  |  Type   | Collation | NOT NULL Constraint | Default | Storage | Description 
+----------+---------+-----------+---------------------+---------+---------+-------------
+ thousand | integer |           |                     |         | plain   | 
 View definition:
  SELECT thousand
    FROM onek
diff --git a/src/test/regress/expected/matview.out b/src/test/regress/expected/matview.out
index 87b6e569a5..de5b8e8004 100644
--- a/src/test/regress/expected/matview.out
+++ b/src/test/regress/expected/matview.out
@@ -94,11 +94,11 @@ CREATE MATERIALIZED VIEW mvtest_bb AS SELECT * FROM mvtest_tvvmv;
 CREATE INDEX mvtest_aa ON mvtest_bb (grandtot);
 -- check that plans seem reasonable
 \d+ mvtest_tvm
-                           Materialized view "public.mvtest_tvm"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- type   | text    |           |          |         | extended |              | 
- totamt | numeric |           |          |         | main     |              | 
+                                Materialized view "public.mvtest_tvm"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ type   | text    |           |                     |         | extended |              | 
+ totamt | numeric |           |                     |         | main     |              | 
 View definition:
  SELECT type,
     totamt
@@ -106,11 +106,11 @@ View definition:
   ORDER BY type;
 
 \d+ mvtest_tvm
-                           Materialized view "public.mvtest_tvm"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- type   | text    |           |          |         | extended |              | 
- totamt | numeric |           |          |         | main     |              | 
+                                Materialized view "public.mvtest_tvm"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ type   | text    |           |                     |         | extended |              | 
+ totamt | numeric |           |                     |         | main     |              | 
 View definition:
  SELECT type,
     totamt
@@ -118,19 +118,19 @@ View definition:
   ORDER BY type;
 
 \d+ mvtest_tvvm
-                           Materialized view "public.mvtest_tvvm"
-  Column  |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
-----------+---------+-----------+----------+---------+---------+--------------+-------------
- grandtot | numeric |           |          |         | main    |              | 
+                                Materialized view "public.mvtest_tvvm"
+  Column  |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+----------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ grandtot | numeric |           |                     |         | main    |              | 
 View definition:
  SELECT grandtot
    FROM mvtest_tvv;
 
 \d+ mvtest_bb
-                            Materialized view "public.mvtest_bb"
-  Column  |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
-----------+---------+-----------+----------+---------+---------+--------------+-------------
- grandtot | numeric |           |          |         | main    |              | 
+                                 Materialized view "public.mvtest_bb"
+  Column  |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+----------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ grandtot | numeric |           |                     |         | main    |              | 
 Indexes:
     "mvtest_aa" btree (grandtot)
 View definition:
@@ -142,10 +142,10 @@ CREATE SCHEMA mvtest_mvschema;
 ALTER MATERIALIZED VIEW mvtest_tvm SET SCHEMA mvtest_mvschema;
 \d+ mvtest_tvm
 \d+ mvtest_tvmm
-                           Materialized view "public.mvtest_tvmm"
-  Column  |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
-----------+---------+-----------+----------+---------+---------+--------------+-------------
- grandtot | numeric |           |          |         | main    |              | 
+                                Materialized view "public.mvtest_tvmm"
+  Column  |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+----------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ grandtot | numeric |           |                     |         | main    |              | 
 Indexes:
     "mvtest_tvmm_expr" UNIQUE, btree ((grandtot > 0::numeric))
     "mvtest_tvmm_pred" UNIQUE, btree (grandtot) WHERE grandtot < 0::numeric
@@ -155,11 +155,11 @@ View definition:
 
 SET search_path = mvtest_mvschema, public;
 \d+ mvtest_tvm
-                      Materialized view "mvtest_mvschema.mvtest_tvm"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- type   | text    |           |          |         | extended |              | 
- totamt | numeric |           |          |         | main     |              | 
+                            Materialized view "mvtest_mvschema.mvtest_tvm"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ type   | text    |           |                     |         | extended |              | 
+ totamt | numeric |           |                     |         | main     |              | 
 View definition:
  SELECT type,
     totamt
@@ -340,11 +340,11 @@ ROLLBACK;
 CREATE VIEW mvtest_vt1 AS SELECT 1 moo;
 CREATE VIEW mvtest_vt2 AS SELECT moo, 2*moo FROM mvtest_vt1 UNION ALL SELECT moo, 3*moo FROM mvtest_vt1;
 \d+ mvtest_vt2
-                          View "public.mvtest_vt2"
-  Column  |  Type   | Collation | Nullable | Default | Storage | Description 
-----------+---------+-----------+----------+---------+---------+-------------
- moo      | integer |           |          |         | plain   | 
- ?column? | integer |           |          |         | plain   | 
+                                View "public.mvtest_vt2"
+  Column  |  Type   | Collation | NOT NULL Constraint | Default | Storage | Description 
+----------+---------+-----------+---------------------+---------+---------+-------------
+ moo      | integer |           |                     |         | plain   | 
+ ?column? | integer |           |                     |         | plain   | 
 View definition:
  SELECT mvtest_vt1.moo,
     2 * mvtest_vt1.moo AS "?column?"
@@ -356,11 +356,11 @@ UNION ALL
 
 CREATE MATERIALIZED VIEW mv_test2 AS SELECT moo, 2*moo FROM mvtest_vt2 UNION ALL SELECT moo, 3*moo FROM mvtest_vt2;
 \d+ mv_test2
-                            Materialized view "public.mv_test2"
-  Column  |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
-----------+---------+-----------+----------+---------+---------+--------------+-------------
- moo      | integer |           |          |         | plain   |              | 
- ?column? | integer |           |          |         | plain   |              | 
+                                  Materialized view "public.mv_test2"
+  Column  |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+----------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ moo      | integer |           |                     |         | plain   |              | 
+ ?column? | integer |           |                     |         | plain   |              | 
 View definition:
  SELECT mvtest_vt2.moo,
     2 * mvtest_vt2.moo AS "?column?"
@@ -493,14 +493,14 @@ drop cascades to materialized view mvtest_mv_v_4
 CREATE MATERIALIZED VIEW mv_unspecified_types AS
   SELECT 42 as i, 42.5 as num, 'foo' as u, 'foo'::unknown as u2, null as n;
 \d+ mv_unspecified_types
-                      Materialized view "public.mv_unspecified_types"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- i      | integer |           |          |         | plain    |              | 
- num    | numeric |           |          |         | main     |              | 
- u      | text    |           |          |         | extended |              | 
- u2     | text    |           |          |         | extended |              | 
- n      | text    |           |          |         | extended |              | 
+                           Materialized view "public.mv_unspecified_types"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ i      | integer |           |                     |         | plain    |              | 
+ num    | numeric |           |                     |         | main     |              | 
+ u      | text    |           |                     |         | extended |              | 
+ u2     | text    |           |                     |         | extended |              | 
+ n      | text    |           |                     |         | extended |              | 
 View definition:
  SELECT 42 AS i,
     42.5 AS num,
diff --git a/src/test/regress/expected/polymorphism.out b/src/test/regress/expected/polymorphism.out
index bf08e40ed8..bd395d2291 100644
--- a/src/test/regress/expected/polymorphism.out
+++ b/src/test/regress/expected/polymorphism.out
@@ -1793,13 +1793,13 @@ select * from dfview;
 (5 rows)
 
 \d+ dfview
-                           View "public.dfview"
- Column |  Type  | Collation | Nullable | Default | Storage | Description 
---------+--------+-----------+----------+---------+---------+-------------
- q1     | bigint |           |          |         | plain   | 
- q2     | bigint |           |          |         | plain   | 
- c3     | bigint |           |          |         | plain   | 
- c4     | bigint |           |          |         | plain   | 
+                                View "public.dfview"
+ Column |  Type  | Collation | NOT NULL Constraint | Default | Storage | Description 
+--------+--------+-----------+---------------------+---------+---------+-------------
+ q1     | bigint |           |                     |         | plain   | 
+ q2     | bigint |           |                     |         | plain   | 
+ c3     | bigint |           |                     |         | plain   | 
+ c4     | bigint |           |                     |         | plain   | 
 View definition:
  SELECT q1,
     q2,
diff --git a/src/test/regress/expected/psql.out b/src/test/regress/expected/psql.out
index 8fc62cebd2..b5a34a9a7b 100644
--- a/src/test/regress/expected/psql.out
+++ b/src/test/regress/expected/psql.out
@@ -2857,34 +2857,34 @@ CREATE TABLE tbl_heap(f1 int, f2 char(100)) using heap;
 CREATE VIEW view_heap_psql AS SELECT f1 from tbl_heap_psql;
 CREATE MATERIALIZED VIEW mat_view_heap_psql USING heap_psql AS SELECT f1 from tbl_heap_psql;
 \d+ tbl_heap_psql
-                              Table "tableam_display.tbl_heap_psql"
- Column |      Type      | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+----------------+-----------+----------+---------+----------+--------------+-------------
- f1     | integer        |           |          |         | plain    |              | 
- f2     | character(100) |           |          |         | extended |              | 
+                                    Table "tableam_display.tbl_heap_psql"
+ Column |      Type      | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+----------------+-----------+---------------------+---------+----------+--------------+-------------
+ f1     | integer        |           |                     |         | plain    |              | 
+ f2     | character(100) |           |                     |         | extended |              | 
 
 \d+ tbl_heap
-                                 Table "tableam_display.tbl_heap"
- Column |      Type      | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+----------------+-----------+----------+---------+----------+--------------+-------------
- f1     | integer        |           |          |         | plain    |              | 
- f2     | character(100) |           |          |         | extended |              | 
+                                      Table "tableam_display.tbl_heap"
+ Column |      Type      | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+----------------+-----------+---------------------+---------+----------+--------------+-------------
+ f1     | integer        |           |                     |         | plain    |              | 
+ f2     | character(100) |           |                     |         | extended |              | 
 
 \set HIDE_TABLEAM off
 \d+ tbl_heap_psql
-                              Table "tableam_display.tbl_heap_psql"
- Column |      Type      | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+----------------+-----------+----------+---------+----------+--------------+-------------
- f1     | integer        |           |          |         | plain    |              | 
- f2     | character(100) |           |          |         | extended |              | 
+                                    Table "tableam_display.tbl_heap_psql"
+ Column |      Type      | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+----------------+-----------+---------------------+---------+----------+--------------+-------------
+ f1     | integer        |           |                     |         | plain    |              | 
+ f2     | character(100) |           |                     |         | extended |              | 
 Access method: heap_psql
 
 \d+ tbl_heap
-                                 Table "tableam_display.tbl_heap"
- Column |      Type      | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+----------------+-----------+----------+---------+----------+--------------+-------------
- f1     | integer        |           |          |         | plain    |              | 
- f2     | character(100) |           |          |         | extended |              | 
+                                      Table "tableam_display.tbl_heap"
+ Column |      Type      | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+----------------+-----------+---------------------+---------+----------+--------------+-------------
+ f1     | integer        |           |                     |         | plain    |              | 
+ f2     | character(100) |           |                     |         | extended |              | 
 Access method: heap
 
 -- AM is displayed for tables, indexes and materialized views.
diff --git a/src/test/regress/expected/publication.out b/src/test/regress/expected/publication.out
index 427f87ea07..62c790c622 100644
--- a/src/test/regress/expected/publication.out
+++ b/src/test/regress/expected/publication.out
@@ -175,11 +175,11 @@ SELECT pubname, puballtables FROM pg_publication WHERE pubname = 'testpub_forall
 (1 row)
 
 \d+ testpub_tbl2
-                                                Table "public.testpub_tbl2"
- Column |  Type   | Collation | Nullable |                 Default                  | Storage  | Stats target | Description 
---------+---------+-----------+----------+------------------------------------------+----------+--------------+-------------
- id     | integer |           | not null | nextval('testpub_tbl2_id_seq'::regclass) | plain    |              | 
- data   | text    |           |          |                                          | extended |              | 
+                                                        Table "public.testpub_tbl2"
+ Column |  Type   | Collation |   NOT NULL Constraint    |                 Default                  | Storage  | Stats target | Description 
+--------+---------+-----------+--------------------------+------------------------------------------+----------+--------------+-------------
+ id     | integer |           | testpub_tbl2_id_not_null | nextval('testpub_tbl2_id_seq'::regclass) | plain    |              | 
+ data   | text    |           |                          |                                          | extended |              | 
 Indexes:
     "testpub_tbl2_pkey" PRIMARY KEY, btree (id)
 Publications:
@@ -735,12 +735,12 @@ UPDATE testpub_tbl6 SET a = 1;
 CREATE TABLE testpub_tbl7 (a int primary key, b text, c text);
 ALTER PUBLICATION testpub_fortable ADD TABLE testpub_tbl7 (a, b);
 \d+ testpub_tbl7
-                                Table "public.testpub_tbl7"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- a      | integer |           | not null |         | plain    |              | 
- b      | text    |           |          |         | extended |              | 
- c      | text    |           |          |         | extended |              | 
+                                     Table "public.testpub_tbl7"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ a      | integer |           | (primary key)       |         | plain    |              | 
+ b      | text    |           |                     |         | extended |              | 
+ c      | text    |           |                     |         | extended |              | 
 Indexes:
     "testpub_tbl7_pkey" PRIMARY KEY, btree (a)
 Publications:
@@ -749,12 +749,12 @@ Publications:
 -- ok: the column list is the same, we should skip this table (or at least not fail)
 ALTER PUBLICATION testpub_fortable SET TABLE testpub_tbl7 (a, b);
 \d+ testpub_tbl7
-                                Table "public.testpub_tbl7"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- a      | integer |           | not null |         | plain    |              | 
- b      | text    |           |          |         | extended |              | 
- c      | text    |           |          |         | extended |              | 
+                                     Table "public.testpub_tbl7"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ a      | integer |           | (primary key)       |         | plain    |              | 
+ b      | text    |           |                     |         | extended |              | 
+ c      | text    |           |                     |         | extended |              | 
 Indexes:
     "testpub_tbl7_pkey" PRIMARY KEY, btree (a)
 Publications:
@@ -763,12 +763,12 @@ Publications:
 -- ok: the column list changes, make sure the catalog gets updated
 ALTER PUBLICATION testpub_fortable SET TABLE testpub_tbl7 (a, c);
 \d+ testpub_tbl7
-                                Table "public.testpub_tbl7"
- Column |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------+----------+--------------+-------------
- a      | integer |           | not null |         | plain    |              | 
- b      | text    |           |          |         | extended |              | 
- c      | text    |           |          |         | extended |              | 
+                                     Table "public.testpub_tbl7"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+---------+-----------+---------------------+---------+----------+--------------+-------------
+ a      | integer |           | (primary key)       |         | plain    |              | 
+ b      | text    |           |                     |         | extended |              | 
+ c      | text    |           |                     |         | extended |              | 
 Indexes:
     "testpub_tbl7_pkey" PRIMARY KEY, btree (a)
 Publications:
@@ -899,12 +899,12 @@ Tables:
     "public.testpub_tbl_both_filters" (a, c) WHERE (c <> 1)
 
 \d+ testpub_tbl_both_filters
-                         Table "public.testpub_tbl_both_filters"
- Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
---------+---------+-----------+----------+---------+---------+--------------+-------------
- a      | integer |           | not null |         | plain   |              | 
- b      | integer |           |          |         | plain   |              | 
- c      | integer |           | not null |         | plain   |              | 
+                               Table "public.testpub_tbl_both_filters"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ a      | integer |           | (primary key)       |         | plain   |              | 
+ b      | integer |           |                     |         | plain   |              | 
+ c      | integer |           | (primary key)       |         | plain   |              | 
 Indexes:
     "testpub_tbl_both_filters_pkey" PRIMARY KEY, btree (a, c) REPLICA IDENTITY
 Publications:
@@ -1116,22 +1116,22 @@ ALTER PUBLICATION testpub_default SET TABLE testpub_tbl1;
 ALTER PUBLICATION testpub_default ADD TABLE pub_test.testpub_nopk;
 ALTER PUBLICATION testpib_ins_trunct ADD TABLE pub_test.testpub_nopk, testpub_tbl1;
 \d+ pub_test.testpub_nopk
-                              Table "pub_test.testpub_nopk"
- Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
---------+---------+-----------+----------+---------+---------+--------------+-------------
- foo    | integer |           |          |         | plain   |              | 
- bar    | integer |           |          |         | plain   |              | 
+                                    Table "pub_test.testpub_nopk"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ foo    | integer |           |                     |         | plain   |              | 
+ bar    | integer |           |                     |         | plain   |              | 
 Publications:
     "testpib_ins_trunct"
     "testpub_default"
     "testpub_fortbl"
 
 \d+ testpub_tbl1
-                                                Table "public.testpub_tbl1"
- Column |  Type   | Collation | Nullable |                 Default                  | Storage  | Stats target | Description 
---------+---------+-----------+----------+------------------------------------------+----------+--------------+-------------
- id     | integer |           | not null | nextval('testpub_tbl1_id_seq'::regclass) | plain    |              | 
- data   | text    |           |          |                                          | extended |              | 
+                                                        Table "public.testpub_tbl1"
+ Column |  Type   | Collation |   NOT NULL Constraint    |                 Default                  | Storage  | Stats target | Description 
+--------+---------+-----------+--------------------------+------------------------------------------+----------+--------------+-------------
+ id     | integer |           | testpub_tbl1_id_not_null | nextval('testpub_tbl1_id_seq'::regclass) | plain    |              | 
+ data   | text    |           |                          |                                          | extended |              | 
 Indexes:
     "testpub_tbl1_pkey" PRIMARY KEY, btree (id)
 Publications:
@@ -1153,11 +1153,11 @@ ALTER PUBLICATION testpub_default DROP TABLE testpub_tbl1, pub_test.testpub_nopk
 ALTER PUBLICATION testpub_default DROP TABLE pub_test.testpub_nopk;
 ERROR:  relation "testpub_nopk" is not part of the publication
 \d+ testpub_tbl1
-                                                Table "public.testpub_tbl1"
- Column |  Type   | Collation | Nullable |                 Default                  | Storage  | Stats target | Description 
---------+---------+-----------+----------+------------------------------------------+----------+--------------+-------------
- id     | integer |           | not null | nextval('testpub_tbl1_id_seq'::regclass) | plain    |              | 
- data   | text    |           |          |                                          | extended |              | 
+                                                        Table "public.testpub_tbl1"
+ Column |  Type   | Collation |   NOT NULL Constraint    |                 Default                  | Storage  | Stats target | Description 
+--------+---------+-----------+--------------------------+------------------------------------------+----------+--------------+-------------
+ id     | integer |           | testpub_tbl1_id_not_null | nextval('testpub_tbl1_id_seq'::regclass) | plain    |              | 
+ data   | text    |           |                          |                                          | extended |              | 
 Indexes:
     "testpub_tbl1_pkey" PRIMARY KEY, btree (id)
 Publications:
diff --git a/src/test/regress/expected/replica_identity.out b/src/test/regress/expected/replica_identity.out
index 9571840d25..f1f2afd9be 100644
--- a/src/test/regress/expected/replica_identity.out
+++ b/src/test/regress/expected/replica_identity.out
@@ -153,13 +153,13 @@ SELECT relreplident FROM pg_class WHERE oid = 'test_replica_identity'::regclass;
 (1 row)
 
 \d+ test_replica_identity
-                                                Table "public.test_replica_identity"
- Column |  Type   | Collation | Nullable |                      Default                      | Storage  | Stats target | Description 
---------+---------+-----------+----------+---------------------------------------------------+----------+--------------+-------------
- id     | integer |           | not null | nextval('test_replica_identity_id_seq'::regclass) | plain    |              | 
- keya   | text    |           | not null |                                                   | extended |              | 
- keyb   | text    |           | not null |                                                   | extended |              | 
- nonkey | text    |           |          |                                                   | extended |              | 
+                                                              Table "public.test_replica_identity"
+ Column |  Type   | Collation |         NOT NULL Constraint         |                      Default                      | Storage  | Stats target | Description 
+--------+---------+-----------+-------------------------------------+---------------------------------------------------+----------+--------------+-------------
+ id     | integer |           | test_replica_identity_id_not_null   | nextval('test_replica_identity_id_seq'::regclass) | plain    |              | 
+ keya   | text    |           | test_replica_identity_keya_not_null |                                                   | extended |              | 
+ keyb   | text    |           | test_replica_identity_keyb_not_null |                                                   | extended |              | 
+ nonkey | text    |           |                                     |                                                   | extended |              | 
 Indexes:
     "test_replica_identity_pkey" PRIMARY KEY, btree (id)
     "test_replica_identity_expr" UNIQUE, btree (keya, keyb, (3))
@@ -242,10 +242,10 @@ ALTER TABLE ONLY test_replica_identity4
 ALTER TABLE ONLY test_replica_identity4_1
   ADD CONSTRAINT test_replica_identity4_1_pkey PRIMARY KEY (id);
 \d+ test_replica_identity4
-                    Partitioned table "public.test_replica_identity4"
- Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
---------+---------+-----------+----------+---------+---------+--------------+-------------
- id     | integer |           | not null |         | plain   |              | 
+                                 Partitioned table "public.test_replica_identity4"
+ Column |  Type   | Collation |        NOT NULL Constraint         | Default | Storage | Stats target | Description 
+--------+---------+-----------+------------------------------------+---------+---------+--------------+-------------
+ id     | integer |           | test_replica_identity4_id_not_null |         | plain   |              | 
 Partition key: LIST (id)
 Indexes:
     "test_replica_identity4_pkey" PRIMARY KEY, btree (id) INVALID REPLICA IDENTITY
@@ -254,10 +254,10 @@ Partitions: test_replica_identity4_1 FOR VALUES IN (1)
 ALTER INDEX test_replica_identity4_pkey
   ATTACH PARTITION test_replica_identity4_1_pkey;
 \d+ test_replica_identity4
-                    Partitioned table "public.test_replica_identity4"
- Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
---------+---------+-----------+----------+---------+---------+--------------+-------------
- id     | integer |           | not null |         | plain   |              | 
+                                 Partitioned table "public.test_replica_identity4"
+ Column |  Type   | Collation |        NOT NULL Constraint         | Default | Storage | Stats target | Description 
+--------+---------+-----------+------------------------------------+---------+---------+--------------+-------------
+ id     | integer |           | test_replica_identity4_id_not_null |         | plain   |              | 
 Partition key: LIST (id)
 Indexes:
     "test_replica_identity4_pkey" PRIMARY KEY, btree (id) REPLICA IDENTITY
diff --git a/src/test/regress/expected/rowsecurity.out b/src/test/regress/expected/rowsecurity.out
index a415ad168c..6e9dcfb419 100644
--- a/src/test/regress/expected/rowsecurity.out
+++ b/src/test/regress/expected/rowsecurity.out
@@ -938,14 +938,14 @@ CREATE POLICY pp1 ON part_document AS PERMISSIVE
 CREATE POLICY pp1r ON part_document AS RESTRICTIVE TO regress_rls_dave
     USING (cid < 55);
 \d+ part_document
-                    Partitioned table "regress_rls_schema.part_document"
- Column  |  Type   | Collation | Nullable | Default | Storage  | Stats target | Description 
----------+---------+-----------+----------+---------+----------+--------------+-------------
- did     | integer |           |          |         | plain    |              | 
- cid     | integer |           |          |         | plain    |              | 
- dlevel  | integer |           | not null |         | plain    |              | 
- dauthor | name    |           |          |         | plain    |              | 
- dtitle  | text    |           |          |         | extended |              | 
+                              Partitioned table "regress_rls_schema.part_document"
+ Column  |  Type   | Collation |      NOT NULL Constraint      | Default | Storage  | Stats target | Description 
+---------+---------+-----------+-------------------------------+---------+----------+--------------+-------------
+ did     | integer |           |                               |         | plain    |              | 
+ cid     | integer |           |                               |         | plain    |              | 
+ dlevel  | integer |           | part_document_dlevel_not_null |         | plain    |              | 
+ dauthor | name    |           |                               |         | plain    |              | 
+ dtitle  | text    |           |                               |         | extended |              | 
 Partition key: RANGE (cid)
 Policies:
     POLICY "pp1"
diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out
index e953d1f515..610e88cdf0 100644
--- a/src/test/regress/expected/rules.out
+++ b/src/test/regress/expected/rules.out
@@ -3014,11 +3014,11 @@ create rule r7 as on delete to rules_src do instead
   returning trgt.f1, trgt.f2;
 -- check display of all rules added above
 \d+ rules_src
-                                 Table "public.rules_src"
- Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
---------+---------+-----------+----------+---------+---------+--------------+-------------
- f1     | integer |           |          |         | plain   |              | 
- f2     | integer |           |          | 0       | plain   |              | 
+                                      Table "public.rules_src"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ f1     | integer |           |                     |         | plain   |              | 
+ f2     | integer |           |                     | 0       | plain   |              | 
 Rules:
     r1 AS
     ON UPDATE TO rules_src DO  INSERT INTO rules_log (f1, f2, tag, id) VALUES (old.f1,old.f2,'old'::text,DEFAULT), (new.f1,new.f2,'new'::text,DEFAULT)
@@ -3067,11 +3067,11 @@ create rule rr as on update to rule_t1 do instead UPDATE rule_dest trgt
   SET (f2[1], f1, tag) = (SELECT new.f2, new.f1, 'updated'::varchar)
   WHERE trgt.f1 = new.f1 RETURNING new.*;
 \d+ rule_t1
-                                  Table "public.rule_t1"
- Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
---------+---------+-----------+----------+---------+---------+--------------+-------------
- f1     | integer |           |          |         | plain   |              | 
- f2     | integer |           |          |         | plain   |              | 
+                                       Table "public.rule_t1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ f1     | integer |           |                     |         | plain   |              | 
+ f2     | integer |           |                     |         | plain   |              | 
 Rules:
     rr AS
     ON UPDATE TO rule_t1 DO INSTEAD  UPDATE rule_dest trgt SET (f2[1], f1, tag) = ( SELECT new.f2,
@@ -3125,10 +3125,10 @@ SELECT * FROM rule_v1;
 (1 row)
 
 \d+ rule_v1
-                           View "public.rule_v1"
- Column |  Type   | Collation | Nullable | Default | Storage | Description 
---------+---------+-----------+----------+---------+---------+-------------
- a      | integer |           |          |         | plain   | 
+                                View "public.rule_v1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Description 
+--------+---------+-----------+---------------------+---------+---------+-------------
+ a      | integer |           |                     |         | plain   | 
 View definition:
  SELECT a
    FROM rule_t1;
@@ -3153,21 +3153,21 @@ DROP TABLE rule_t1;
 --
 create view rule_v1 as values(1,2);
 \d+ rule_v1
-                           View "public.rule_v1"
- Column  |  Type   | Collation | Nullable | Default | Storage | Description 
----------+---------+-----------+----------+---------+---------+-------------
- column1 | integer |           |          |         | plain   | 
- column2 | integer |           |          |         | plain   | 
+                                 View "public.rule_v1"
+ Column  |  Type   | Collation | NOT NULL Constraint | Default | Storage | Description 
+---------+---------+-----------+---------------------+---------+---------+-------------
+ column1 | integer |           |                     |         | plain   | 
+ column2 | integer |           |                     |         | plain   | 
 View definition:
  VALUES (1,2);
 
 alter table rule_v1 rename column column2 to q2;
 \d+ rule_v1
-                           View "public.rule_v1"
- Column  |  Type   | Collation | Nullable | Default | Storage | Description 
----------+---------+-----------+----------+---------+---------+-------------
- column1 | integer |           |          |         | plain   | 
- q2      | integer |           |          |         | plain   | 
+                                 View "public.rule_v1"
+ Column  |  Type   | Collation | NOT NULL Constraint | Default | Storage | Description 
+---------+---------+-----------+---------------------+---------+---------+-------------
+ column1 | integer |           |                     |         | plain   | 
+ q2      | integer |           |                     |         | plain   | 
 View definition:
  SELECT column1,
     column2 AS q2
@@ -3176,11 +3176,11 @@ View definition:
 drop view rule_v1;
 create view rule_v1(x) as values(1,2);
 \d+ rule_v1
-                           View "public.rule_v1"
- Column  |  Type   | Collation | Nullable | Default | Storage | Description 
----------+---------+-----------+----------+---------+---------+-------------
- x       | integer |           |          |         | plain   | 
- column2 | integer |           |          |         | plain   | 
+                                 View "public.rule_v1"
+ Column  |  Type   | Collation | NOT NULL Constraint | Default | Storage | Description 
+---------+---------+-----------+---------------------+---------+---------+-------------
+ x       | integer |           |                     |         | plain   | 
+ column2 | integer |           |                     |         | plain   | 
 View definition:
  SELECT column1 AS x,
     column2
@@ -3189,11 +3189,11 @@ View definition:
 drop view rule_v1;
 create view rule_v1(x) as select * from (values(1,2)) v;
 \d+ rule_v1
-                           View "public.rule_v1"
- Column  |  Type   | Collation | Nullable | Default | Storage | Description 
----------+---------+-----------+----------+---------+---------+-------------
- x       | integer |           |          |         | plain   | 
- column2 | integer |           |          |         | plain   | 
+                                 View "public.rule_v1"
+ Column  |  Type   | Collation | NOT NULL Constraint | Default | Storage | Description 
+---------+---------+-----------+---------------------+---------+---------+-------------
+ x       | integer |           |                     |         | plain   | 
+ column2 | integer |           |                     |         | plain   | 
 View definition:
  SELECT column1 AS x,
     column2
@@ -3202,11 +3202,11 @@ View definition:
 drop view rule_v1;
 create view rule_v1(x) as select * from (values(1,2)) v(q,w);
 \d+ rule_v1
-                           View "public.rule_v1"
- Column |  Type   | Collation | Nullable | Default | Storage | Description 
---------+---------+-----------+----------+---------+---------+-------------
- x      | integer |           |          |         | plain   | 
- w      | integer |           |          |         | plain   | 
+                                View "public.rule_v1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Description 
+--------+---------+-----------+---------------------+---------+---------+-------------
+ x      | integer |           |                     |         | plain   | 
+ w      | integer |           |                     |         | plain   | 
 View definition:
  SELECT q AS x,
     w
diff --git a/src/test/regress/expected/stats_ext.out b/src/test/regress/expected/stats_ext.out
index 03880874c1..e5e088ae26 100644
--- a/src/test/regress/expected/stats_ext.out
+++ b/src/test/regress/expected/stats_ext.out
@@ -150,11 +150,11 @@ SELECT stxname, stxdndistinct, stxddependencies, stxdmcv, stxdinherit
 
 ALTER STATISTICS ab1_a_b_stats SET STATISTICS -1;
 \d+ ab1
-                                    Table "public.ab1"
- Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
---------+---------+-----------+----------+---------+---------+--------------+-------------
- a      | integer |           |          |         | plain   |              | 
- b      | integer |           |          |         | plain   |              | 
+                                         Table "public.ab1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ a      | integer |           |                     |         | plain   |              | 
+ b      | integer |           |                     |         | plain   |              | 
 Statistics objects:
     "public.ab1_a_b_stats" ON a, b FROM ab1
 
diff --git a/src/test/regress/expected/tablesample.out b/src/test/regress/expected/tablesample.out
index 9ff4611640..2c6defc350 100644
--- a/src/test/regress/expected/tablesample.out
+++ b/src/test/regress/expected/tablesample.out
@@ -69,19 +69,19 @@ CREATE VIEW test_tablesample_v1 AS
 CREATE VIEW test_tablesample_v2 AS
   SELECT id FROM test_tablesample TABLESAMPLE SYSTEM (99);
 \d+ test_tablesample_v1
-                     View "public.test_tablesample_v1"
- Column |  Type   | Collation | Nullable | Default | Storage | Description 
---------+---------+-----------+----------+---------+---------+-------------
- id     | integer |           |          |         | plain   | 
+                          View "public.test_tablesample_v1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Description 
+--------+---------+-----------+---------------------+---------+---------+-------------
+ id     | integer |           |                     |         | plain   | 
 View definition:
  SELECT id
    FROM test_tablesample TABLESAMPLE system ((10 * 2)) REPEATABLE (2);
 
 \d+ test_tablesample_v2
-                     View "public.test_tablesample_v2"
- Column |  Type   | Collation | Nullable | Default | Storage | Description 
---------+---------+-----------+----------+---------+---------+-------------
- id     | integer |           |          |         | plain   | 
+                          View "public.test_tablesample_v2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Description 
+--------+---------+-----------+---------------------+---------+---------+-------------
+ id     | integer |           |                     |         | plain   | 
 View definition:
  SELECT id
    FROM test_tablesample TABLESAMPLE system (99);
diff --git a/src/test/regress/expected/tablespace.out b/src/test/regress/expected/tablespace.out
index 9aabb85349..62dff66e68 100644
--- a/src/test/regress/expected/tablespace.out
+++ b/src/test/regress/expected/tablespace.out
@@ -348,10 +348,10 @@ Indexes:
 Number of partitions: 2 (Use \d+ to list them.)
 
 \d+ testschema.part
-                           Partitioned table "testschema.part"
- Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
---------+---------+-----------+----------+---------+---------+--------------+-------------
- a      | integer |           |          |         | plain   |              | 
+                                 Partitioned table "testschema.part"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ a      | integer |           |                     |         | plain   |              | 
 Partition key: LIST (a)
 Indexes:
     "part_a_idx" btree (a), tablespace "regress_tblspace"
@@ -368,10 +368,10 @@ Indexes:
     "part1_a_idx" btree (a), tablespace "regress_tblspace"
 
 \d+ testschema.part1
-                                 Table "testschema.part1"
- Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
---------+---------+-----------+----------+---------+---------+--------------+-------------
- a      | integer |           |          |         | plain   |              | 
+                                      Table "testschema.part1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ a      | integer |           |                     |         | plain   |              | 
 Partition of: testschema.part FOR VALUES IN (1)
 Partition constraint: ((a IS NOT NULL) AND (a = 1))
 Indexes:
diff --git a/src/test/regress/expected/triggers.out b/src/test/regress/expected/triggers.out
index 7dbeced570..0a41c01527 100644
--- a/src/test/regress/expected/triggers.out
+++ b/src/test/regress/expected/triggers.out
@@ -1271,11 +1271,11 @@ Triggers:
 DROP TRIGGER instead_of_insert_trig ON main_view;
 DROP TRIGGER instead_of_delete_trig ON main_view;
 \d+ main_view
-                          View "public.main_view"
- Column |  Type   | Collation | Nullable | Default | Storage | Description 
---------+---------+-----------+----------+---------+---------+-------------
- a      | integer |           |          |         | plain   | 
- b      | integer |           |          |         | plain   | 
+                               View "public.main_view"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Description 
+--------+---------+-----------+---------------------+---------+---------+-------------
+ a      | integer |           |                     |         | plain   | 
+ b      | integer |           |                     |         | plain   | 
 View definition:
  SELECT a,
     b
@@ -3608,10 +3608,10 @@ create trigger parenttrig after insert on child
 for each row execute procedure f();
 alter trigger parenttrig on parent rename to anothertrig;
 \d+ child
-                                   Table "public.child"
- Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
---------+---------+-----------+----------+---------+---------+--------------+-------------
- a      | integer |           |          |         | plain   |              | 
+                                        Table "public.child"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Stats target | Description 
+--------+---------+-----------+---------------------+---------+---------+--------------+-------------
+ a      | integer |           |                     |         | plain   |              | 
 Triggers:
     parenttrig AFTER INSERT ON child FOR EACH ROW EXECUTE FUNCTION f()
 Inherits: parent
diff --git a/src/test/regress/expected/updatable_views.out b/src/test/regress/expected/updatable_views.out
index 0cbedc657d..587d455787 100644
--- a/src/test/regress/expected/updatable_views.out
+++ b/src/test/regress/expected/updatable_views.out
@@ -1919,11 +1919,11 @@ INSERT INTO base_tbl VALUES (1,2), (2,3), (1,-1);
 CREATE VIEW rw_view1 AS SELECT * FROM base_tbl WHERE a < b
   WITH LOCAL CHECK OPTION;
 \d+ rw_view1
-                          View "public.rw_view1"
- Column |  Type   | Collation | Nullable | Default | Storage | Description 
---------+---------+-----------+----------+---------+---------+-------------
- a      | integer |           |          |         | plain   | 
- b      | integer |           |          |         | plain   | 
+                                View "public.rw_view1"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Description 
+--------+---------+-----------+---------------------+---------+---------+-------------
+ a      | integer |           |                     |         | plain   | 
+ b      | integer |           |                     |         | plain   | 
 View definition:
  SELECT a,
     b
@@ -1973,10 +1973,10 @@ CREATE VIEW rw_view1 AS SELECT * FROM base_tbl WHERE a > 0;
 CREATE VIEW rw_view2 AS SELECT * FROM rw_view1 WHERE a < 10
   WITH CHECK OPTION; -- implicitly cascaded
 \d+ rw_view2
-                          View "public.rw_view2"
- Column |  Type   | Collation | Nullable | Default | Storage | Description 
---------+---------+-----------+----------+---------+---------+-------------
- a      | integer |           |          |         | plain   | 
+                                View "public.rw_view2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Description 
+--------+---------+-----------+---------------------+---------+---------+-------------
+ a      | integer |           |                     |         | plain   | 
 View definition:
  SELECT a
    FROM rw_view1
@@ -2013,10 +2013,10 @@ DETAIL:  Failing row contains (15).
 CREATE OR REPLACE VIEW rw_view2 AS SELECT * FROM rw_view1 WHERE a < 10
   WITH LOCAL CHECK OPTION;
 \d+ rw_view2
-                          View "public.rw_view2"
- Column |  Type   | Collation | Nullable | Default | Storage | Description 
---------+---------+-----------+----------+---------+---------+-------------
- a      | integer |           |          |         | plain   | 
+                                View "public.rw_view2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Description 
+--------+---------+-----------+---------------------+---------+---------+-------------
+ a      | integer |           |                     |         | plain   | 
 View definition:
  SELECT a
    FROM rw_view1
@@ -2054,10 +2054,10 @@ ERROR:  new row violates check option for view "rw_view2"
 DETAIL:  Failing row contains (30).
 ALTER VIEW rw_view2 RESET (check_option);
 \d+ rw_view2
-                          View "public.rw_view2"
- Column |  Type   | Collation | Nullable | Default | Storage | Description 
---------+---------+-----------+----------+---------+---------+-------------
- a      | integer |           |          |         | plain   | 
+                                View "public.rw_view2"
+ Column |  Type   | Collation | NOT NULL Constraint | Default | Storage | Description 
+--------+---------+-----------+---------------------+---------+---------+-------------
+ a      | integer |           |                     |         | plain   | 
 View definition:
  SELECT a
    FROM rw_view1
diff --git a/src/test/regress/expected/update.out b/src/test/regress/expected/update.out
index c809f88f54..3ef07f466b 100644
--- a/src/test/regress/expected/update.out
+++ b/src/test/regress/expected/update.out
@@ -743,14 +743,14 @@ DROP TRIGGER d15_insert_trig ON part_d_15_20;
 :init_range_parted;
 create table part_def partition of range_parted default;
 \d+ part_def
-                                       Table "public.part_def"
- Column |       Type        | Collation | Nullable | Default | Storage  | Stats target | Description 
---------+-------------------+-----------+----------+---------+----------+--------------+-------------
- a      | text              |           |          |         | extended |              | 
- b      | bigint            |           |          |         | plain    |              | 
- c      | numeric           |           |          |         | main     |              | 
- d      | integer           |           |          |         | plain    |              | 
- e      | character varying |           |          |         | extended |              | 
+                                            Table "public.part_def"
+ Column |       Type        | Collation | NOT NULL Constraint | Default | Storage  | Stats target | Description 
+--------+-------------------+-----------+---------------------+---------+----------+--------------+-------------
+ a      | text              |           |                     |         | extended |              | 
+ b      | bigint            |           |                     |         | plain    |              | 
+ c      | numeric           |           |                     |         | main     |              | 
+ d      | integer           |           |                     |         | plain    |              | 
+ e      | character varying |           |                     |         | extended |              | 
 Partition of: range_parted DEFAULT
 Partition constraint: (NOT ((a IS NOT NULL) AND (b IS NOT NULL) AND (((a = 'a'::text) AND (b >= '1'::bigint) AND (b < '10'::bigint)) OR ((a = 'a'::text) AND (b >= '10'::bigint) AND (b < '20'::bigint)) OR ((a = 'b'::text) AND (b >= '1'::bigint) AND (b < '10'::bigint)) OR ((a = 'b'::text) AND (b >= '10'::bigint) AND (b < '20'::bigint)) OR ((a = 'b'::text) AND (b >= '20'::bigint) AND (b < '30'::bigint)))))
 
diff --git a/src/test/regress/expected/with.out b/src/test/regress/expected/with.out
index 88e57a2c87..c00e40e7db 100644
--- a/src/test/regress/expected/with.out
+++ b/src/test/regress/expected/with.out
@@ -434,10 +434,10 @@ UNION ALL
 )
 SELECT sum(n) FROM t;
 \d+ sums_1_100
-                         View "public.sums_1_100"
- Column |  Type  | Collation | Nullable | Default | Storage | Description 
---------+--------+-----------+----------+---------+---------+-------------
- sum    | bigint |           |          |         | plain   | 
+                              View "public.sums_1_100"
+ Column |  Type  | Collation | NOT NULL Constraint | Default | Storage | Description 
+--------+--------+-----------+---------------------+---------+---------+-------------
+ sum    | bigint |           |                     |         | plain   | 
 View definition:
  WITH RECURSIVE t(n) AS (
          VALUES (1)
-- 
2.30.2

