]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
psql: Make \d+ partition list formatting consistent with other objects
authorFujii Masao <fujii@postgresql.org>
Mon, 30 Mar 2026 02:06:42 +0000 (11:06 +0900)
committerFujii Masao <fujii@postgresql.org>
Mon, 30 Mar 2026 02:06:42 +0000 (11:06 +0900)
Previously, \d+ <table> displayed partitions differently from other object
lists: the first partition appeared on the same line as the "Partitions"
header. For example:

    Partitions: pt12 FOR VALUES IN (1, 2),
                pt34 FOR VALUES IN (3, 4)

This commit updates the output so that partitions are listed consistently
with other objects, with each entry on its own line starting below the header:

    Partitions:
        pt12 FOR VALUES IN (1, 2)
        pt34 FOR VALUES IN (3, 4)

Author: Peter Smith <smithpb2250@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Neil Chen <carpenter.nail.cz@gmail.com>
Reviewed-by: Greg Sabino Mullane <htamfids@gmail.com>
Reviewed-by: Soumya S Murali <soumyamurali.work@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/CAHut+Pu1puO00C-OhgLnAcECzww8MB3Q8DCsvx0cZWHRfs4gBQ@mail.gmail.com

12 files changed:
contrib/seg/expected/partition.out
src/bin/psql/describe.c
src/test/regress/expected/alter_table.out
src/test/regress/expected/constraints.out
src/test/regress/expected/create_table.out
src/test/regress/expected/foreign_data.out
src/test/regress/expected/inherit.out
src/test/regress/expected/insert.out
src/test/regress/expected/partition_split.out
src/test/regress/expected/replica_identity.out
src/test/regress/expected/rowsecurity.out
src/test/regress/expected/tablespace.out

index 90d8397d5d461302504581d4726a343519cfdc95..8b86a406993c233c8c6c465ab5c356ab852a6981 100644 (file)
@@ -35,8 +35,9 @@ Indexes:
     "pti1" btree ((mydouble(category) + 1))
     "pti2" btree (sdata)
     "pti3" btree (tdata COLLATE mycollation)
-Partitions: pt12 FOR VALUES IN (1, 2),
-            pt34 FOR VALUES IN (3, 4)
+Partitions:
+    pt12 FOR VALUES IN (1, 2)
+    pt34 FOR VALUES IN (3, 4)
 
 \d+ pt12
                                      Table "public.pt12"
index 7d1231c055892f5ec9d9ed0a37d3b6dd7b230a0d..44e6cb6d7ac1f6cf56fe1434af7f7edd7a5913f0 100644 (file)
@@ -3760,18 +3760,18 @@ describeOneTableDetails(const char *schemaname,
                {
                        /* display the list of child tables */
                        const char *ct = is_partitioned ? _("Partitions") : _("Child tables");
-                       int                     ctw = pg_wcswidth(ct, strlen(ct), pset.encoding);
+
+                       if (tuples > 0)
+                       {
+                               printfPQExpBuffer(&buf, "%s:", ct);
+                               printTableAddFooter(&cont, buf.data);
+                       }
 
                        for (i = 0; i < tuples; i++)
                        {
                                char            child_relkind = *PQgetvalue(result, i, 1);
 
-                               if (i == 0)
-                                       printfPQExpBuffer(&buf, "%s: %s",
-                                                                         ct, PQgetvalue(result, i, 0));
-                               else
-                                       printfPQExpBuffer(&buf, "%*s  %s",
-                                                                         ctw, "", PQgetvalue(result, i, 0));
+                               printfPQExpBuffer(&buf, "    %s", PQgetvalue(result, i, 0));
                                if (!PQgetisnull(result, i, 3))
                                        appendPQExpBuffer(&buf, " %s", PQgetvalue(result, i, 3));
                                if (child_relkind == RELKIND_PARTITIONED_TABLE ||
@@ -3781,8 +3781,6 @@ describeOneTableDetails(const char *schemaname,
                                        appendPQExpBufferStr(&buf, ", FOREIGN");
                                if (strcmp(PQgetvalue(result, i, 2), "t") == 0)
                                        appendPQExpBufferStr(&buf, " (DETACH PENDING)");
-                               if (i < tuples - 1)
-                                       appendPQExpBufferChar(&buf, ',');
 
                                printTableAddFooter(&cont, buf.data);
                        }
index ccd79dfecc03cf8311172bf09b1d38a4cc414852..9872899586a660e9a1395f647fcd9c02f9b86055 100644 (file)
@@ -1236,7 +1236,8 @@ primary key, btree, for table "public.atnnpart1"
 Partition key: LIST (id)
 Not-null constraints:
     "dummy_constr" NOT NULL "id" NOT VALID
-Partitions: atnnpart1 FOR VALUES IN (1)
+Partitions:
+    atnnpart1 FOR VALUES IN (1)
 
 BEGIN;
 ALTER TABLE atnnparted VALIDATE CONSTRAINT dummy_constr;
@@ -1267,7 +1268,8 @@ primary key, btree, for table "public.atnnpart1"
 Partition key: LIST (id)
 Not-null constraints:
     "dummy_constr" NOT NULL "id"
-Partitions: atnnpart1 FOR VALUES IN (1)
+Partitions:
+    atnnpart1 FOR VALUES IN (1)
 
 ROLLBACK;
 -- leave a table in this state for the pg_upgrade test
index 0ed817f0c2ca19d960fa6dee6d710c7cf2d4d5aa..75f61377143a063a487d13253ef47d225c4bc7c3 100644 (file)
@@ -1195,7 +1195,8 @@ Indexes:
     "cnn_primarykey" PRIMARY KEY, btree (b)
 Not-null constraints:
     "cnn_pk_b_not_null" NOT NULL "b"
-Child tables: cnn_pk_child
+Child tables:
+    cnn_pk_child
 
                                Table "public.cnn_pk_child"
  Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
@@ -1215,7 +1216,8 @@ ALTER TABLE cnn_pk DROP CONSTRAINT cnn_primarykey;
  b      | integer |           | not null |         | plain   |              | 
 Not-null constraints:
     "cnn_pk_b_not_null" NOT NULL "b"
-Child tables: cnn_pk_child
+Child tables:
+    cnn_pk_child
 
                                Table "public.cnn_pk_child"
  Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
@@ -1240,7 +1242,8 @@ Indexes:
     "cnn_primarykey" PRIMARY KEY, btree (b)
 Not-null constraints:
     "cnn_pk_b_not_null" NOT NULL "b"
-Child tables: cnn_pk_child
+Child tables:
+    cnn_pk_child
 
                                Table "public.cnn_pk_child"
  Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
@@ -1260,7 +1263,8 @@ ALTER TABLE cnn_pk DROP CONSTRAINT cnn_primarykey;
  b      | integer |           | not null |         | plain   |              | 
 Not-null constraints:
     "cnn_pk_b_not_null" NOT NULL "b"
-Child tables: cnn_pk_child
+Child tables:
+    cnn_pk_child
 
                                Table "public.cnn_pk_child"
  Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
@@ -1288,7 +1292,8 @@ Indexes:
     "cnn_primarykey" PRIMARY KEY, btree (b)
 Not-null constraints:
     "cnn_pk_b_not_null" NOT NULL "b"
-Child tables: cnn_pk_child
+Child tables:
+    cnn_pk_child
 
                                Table "public.cnn_pk_child"
  Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
@@ -1356,9 +1361,10 @@ Indexes:
     "notnull_tbl4_pkey" PRIMARY KEY, btree (a) DEFERRABLE INITIALLY DEFERRED
 Not-null constraints:
     "notnull_tbl4_a_not_null" NOT NULL "a"
-Child tables: notnull_tbl4_cld,
-              notnull_tbl4_cld2,
-              notnull_tbl4_cld3
+Child tables:
+    notnull_tbl4_cld
+    notnull_tbl4_cld2
+    notnull_tbl4_cld3
 
 \d+ notnull_tbl4_lk
                               Table "public.notnull_tbl4_lk"
index 90639ea0d8948498ae9756314b7ff2cc9589d2b5..a7a24fa3adcc7846a1adebde85a023a68e44eb89 100644 (file)
@@ -431,10 +431,11 @@ CREATE TABLE part_null PARTITION OF list_parted FOR VALUES IN (null);
 --------+---------+-----------+----------+---------+---------+--------------+-------------
  a      | integer |           |          |         | plain   |              | 
 Partition key: LIST (a)
-Partitions: part_null FOR VALUES IN (NULL),
-            part_p1 FOR VALUES IN (1),
-            part_p2 FOR VALUES IN (2),
-            part_p3 FOR VALUES IN (3)
+Partitions:
+    part_null FOR VALUES IN (NULL)
+    part_p1 FOR VALUES IN (1)
+    part_p2 FOR VALUES IN (2)
+    part_p3 FOR VALUES IN (3)
 
 -- forbidden expressions for partition bound with list partitioned table
 CREATE TABLE part_bogus_expr_fail PARTITION OF list_parted FOR VALUES IN (somename);
@@ -899,7 +900,8 @@ Partition constraint: ((a IS NOT NULL) AND (a = 'c'::text))
 Partition key: RANGE (b)
 Not-null constraints:
     "part_c_b_not_null" NOT NULL "b" (local, inherited)
-Partitions: part_c_1_10 FOR VALUES FROM (1) TO (10)
+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
@@ -1044,8 +1046,9 @@ create table boolspart_f partition of boolspart for values in (false);
 --------+---------+-----------+----------+---------+---------+--------------+-------------
  a      | boolean |           |          |         | plain   |              | 
 Partition key: LIST (a)
-Partitions: boolspart_f FOR VALUES IN (false),
-            boolspart_t FOR VALUES IN (true)
+Partitions:
+    boolspart_f FOR VALUES IN (false)
+    boolspart_t FOR VALUES IN (true)
 
 drop table boolspart;
 -- partitions mixing temporary and permanent relations
index 305a9f9e54e31410bc0c84ce2391927795dc5549..8bf84f28df0fab2a9cf100d4037ba0bc0bcef1f6 100644 (file)
@@ -1445,7 +1445,8 @@ CREATE FOREIGN TABLE ft2 () INHERITS (fd_pt1)
  c3     | date    |           |          |         | plain    |              | 
 Not-null constraints:
     "fd_pt1_c1_not_null" NOT NULL "c1"
-Child tables: ft2, FOREIGN
+Child tables:
+    ft2, FOREIGN
 
 \d+ ft2
                                        Foreign table "public.ft2"
@@ -1498,7 +1499,8 @@ ALTER FOREIGN TABLE ft2 INHERIT fd_pt1;
  c3     | date    |           |          |         | plain    |              | 
 Not-null constraints:
     "fd_pt1_c1_not_null" NOT NULL "c1"
-Child tables: ft2, FOREIGN
+Child tables:
+    ft2, FOREIGN
 
 \d+ ft2
                                        Foreign table "public.ft2"
@@ -1535,8 +1537,9 @@ Not-null constraints:
 Server: s0
 FDW options: (delimiter ',', quote '"', "be quoted" 'value')
 Inherits: fd_pt1
-Child tables: ct3,
-              ft3, FOREIGN
+Child tables:
+    ct3
+    ft3, FOREIGN
 
 \d+ ct3
                                     Table "public.ct3"
@@ -1582,7 +1585,8 @@ ALTER TABLE fd_pt1 ADD COLUMN c8 integer;
 Not-null constraints:
     "fd_pt1_c1_not_null" NOT NULL "c1"
     "fd_pt1_c7_not_null" NOT NULL "c7"
-Child tables: ft2, FOREIGN
+Child tables:
+    ft2, FOREIGN
 
 \d+ ft2
                                        Foreign table "public.ft2"
@@ -1602,8 +1606,9 @@ Not-null constraints:
 Server: s0
 FDW options: (delimiter ',', quote '"', "be quoted" 'value')
 Inherits: fd_pt1
-Child tables: ct3,
-              ft3, FOREIGN
+Child tables:
+    ct3
+    ft3, FOREIGN
 
 \d+ ct3
                                     Table "public.ct3"
@@ -1668,7 +1673,8 @@ ALTER TABLE fd_pt1 ALTER COLUMN c8 SET STORAGE EXTERNAL;
 Not-null constraints:
     "fd_pt1_c1_not_null" NOT NULL "c1"
     "fd_pt1_c6_not_null" NOT NULL "c6"
-Child tables: ft2, FOREIGN
+Child tables:
+    ft2, FOREIGN
 
 \d+ ft2
                                        Foreign table "public.ft2"
@@ -1688,8 +1694,9 @@ Not-null constraints:
 Server: s0
 FDW options: (delimiter ',', quote '"', "be quoted" 'value')
 Inherits: fd_pt1
-Child tables: ct3,
-              ft3, FOREIGN
+Child tables:
+    ct3
+    ft3, FOREIGN
 
 -- drop attributes recursively
 ALTER TABLE fd_pt1 DROP COLUMN c4;
@@ -1706,7 +1713,8 @@ ALTER TABLE fd_pt1 DROP COLUMN c8;
  c3     | date    |           |          |         | plain    |              | 
 Not-null constraints:
     "fd_pt1_c1_not_null" NOT NULL "c1"
-Child tables: ft2, FOREIGN
+Child tables:
+    ft2, FOREIGN
 
 \d+ ft2
                                        Foreign table "public.ft2"
@@ -1720,8 +1728,9 @@ Not-null constraints:
 Server: s0
 FDW options: (delimiter ',', quote '"', "be quoted" 'value')
 Inherits: fd_pt1
-Child tables: ct3,
-              ft3, FOREIGN
+Child tables:
+    ct3
+    ft3, FOREIGN
 
 -- add constraints recursively
 ALTER TABLE fd_pt1 ADD CONSTRAINT fd_pt1chk1 CHECK (c1 > 0) NO INHERIT;
@@ -1751,7 +1760,8 @@ Check constraints:
     "fd_pt1chk2" CHECK (c2 <> ''::text)
 Not-null constraints:
     "fd_pt1_c1_not_null" NOT NULL "c1"
-Child tables: ft2, FOREIGN
+Child tables:
+    ft2, FOREIGN
 
 \d+ ft2
                                        Foreign table "public.ft2"
@@ -1767,8 +1777,9 @@ Not-null constraints:
 Server: s0
 FDW options: (delimiter ',', quote '"', "be quoted" 'value')
 Inherits: fd_pt1
-Child tables: ct3,
-              ft3, FOREIGN
+Child tables:
+    ct3
+    ft3, FOREIGN
 
 DROP FOREIGN TABLE ft2; -- ERROR
 ERROR:  cannot drop foreign table ft2 because other objects depend on it
@@ -1802,7 +1813,8 @@ Check constraints:
     "fd_pt1chk2" CHECK (c2 <> ''::text)
 Not-null constraints:
     "fd_pt1_c1_not_null" NOT NULL "c1"
-Child tables: ft2, FOREIGN
+Child tables:
+    ft2, FOREIGN
 
 \d+ ft2
                                        Foreign table "public.ft2"
@@ -1836,7 +1848,8 @@ Check constraints:
     "fd_pt1chk3" CHECK (c2 <> ''::text) NOT VALID
 Not-null constraints:
     "fd_pt1_c1_not_null" NOT NULL "c1"
-Child tables: ft2, FOREIGN
+Child tables:
+    ft2, FOREIGN
 
 \d+ ft2
                                        Foreign table "public.ft2"
@@ -1867,7 +1880,8 @@ Check constraints:
     "fd_pt1chk3" CHECK (c2 <> ''::text)
 Not-null constraints:
     "fd_pt1_c1_not_null" NOT NULL "c1"
-Child tables: ft2, FOREIGN
+Child tables:
+    ft2, FOREIGN
 
 \d+ ft2
                                        Foreign table "public.ft2"
@@ -1902,7 +1916,8 @@ Check constraints:
     "f2_check" CHECK (f2 <> ''::text)
 Not-null constraints:
     "fd_pt1_c1_not_null" NOT NULL "f1"
-Child tables: ft2, FOREIGN
+Child tables:
+    ft2, FOREIGN
 
 \d+ ft2
                                        Foreign table "public.ft2"
@@ -1964,7 +1979,8 @@ CREATE FOREIGN TABLE fd_pt2_1 PARTITION OF fd_pt2 FOR VALUES IN (1)
 Partition key: LIST (c1)
 Not-null constraints:
     "fd_pt2_c1_not_null" NOT NULL "c1"
-Partitions: fd_pt2_1 FOR VALUES IN (1), FOREIGN
+Partitions:
+    fd_pt2_1 FOR VALUES IN (1), FOREIGN
 
 \d+ fd_pt2_1
                                      Foreign table "public.fd_pt2_1"
@@ -2046,7 +2062,8 @@ ALTER TABLE fd_pt2 ATTACH PARTITION fd_pt2_1 FOR VALUES IN (1);
 Partition key: LIST (c1)
 Not-null constraints:
     "fd_pt2_c1_not_null" NOT NULL "c1"
-Partitions: fd_pt2_1 FOR VALUES IN (1), FOREIGN
+Partitions:
+    fd_pt2_1 FOR VALUES IN (1), FOREIGN
 
 \d+ fd_pt2_1
                                      Foreign table "public.fd_pt2_1"
@@ -2078,7 +2095,8 @@ ALTER TABLE fd_pt2_1 ADD CONSTRAINT p21chk CHECK (c2 <> '');
 Partition key: LIST (c1)
 Not-null constraints:
     "fd_pt2_c1_not_null" NOT NULL "c1"
-Partitions: fd_pt2_1 FOR VALUES IN (1), FOREIGN
+Partitions:
+    fd_pt2_1 FOR VALUES IN (1), FOREIGN
 
 \d+ fd_pt2_1
                                      Foreign table "public.fd_pt2_1"
index 36f81f39265de47d7e425683e6900a0c114a7bf8..7b646836ec948fbd11f0a3805e68c2b3fed27520 100644 (file)
@@ -1110,8 +1110,9 @@ NOTICE:  merging definition of column "j" for child "inhtd"
 --------+---------+-----------+----------+---------+---------+--------------+-------------
  i      | integer |           |          |         | plain   |              | 
  j      | bigint  |           |          | 1       | plain   |              | 
-Child tables: inhtb,
-              inhtd
+Child tables:
+    inhtb
+    inhtd
 
 \d+ inhtd
                                    Table "public.inhtd"
@@ -1204,7 +1205,8 @@ CREATE TABLE test_constraints_inh () INHERITS (test_constraints);
  val2   | integer           |           |          |         | plain    |              | 
 Indexes:
     "test_constraints_val1_val2_key" UNIQUE CONSTRAINT, btree (val1, val2)
-Child tables: test_constraints_inh
+Child tables:
+    test_constraints_inh
 
 ALTER TABLE ONLY test_constraints DROP CONSTRAINT test_constraints_val1_val2_key;
 \d+ test_constraints
@@ -1214,7 +1216,8 @@ ALTER TABLE ONLY test_constraints DROP CONSTRAINT test_constraints_val1_val2_key
  id     | integer           |           |          |         | plain    |              | 
  val1   | character varying |           |          |         | extended |              | 
  val2   | integer           |           |          |         | plain    |              | 
-Child tables: test_constraints_inh
+Child tables:
+    test_constraints_inh
 
 \d+ test_constraints_inh
                                  Table "public.test_constraints_inh"
@@ -1239,7 +1242,8 @@ CREATE TABLE test_ex_constraints_inh () INHERITS (test_ex_constraints);
  c      | circle |           |          |         | plain   |              | 
 Indexes:
     "test_ex_constraints_c_excl" EXCLUDE USING gist (c WITH &&)
-Child tables: test_ex_constraints_inh
+Child tables:
+    test_ex_constraints_inh
 
 ALTER TABLE test_ex_constraints DROP CONSTRAINT test_ex_constraints_c_excl;
 \d+ test_ex_constraints
@@ -1247,7 +1251,8 @@ ALTER TABLE test_ex_constraints DROP CONSTRAINT test_ex_constraints_c_excl;
  Column |  Type  | Collation | Nullable | Default | Storage | Stats target | Description 
 --------+--------+-----------+----------+---------+---------+--------------+-------------
  c      | circle |           |          |         | plain   |              | 
-Child tables: test_ex_constraints_inh
+Child tables:
+    test_ex_constraints_inh
 
 \d+ test_ex_constraints_inh
                          Table "public.test_ex_constraints_inh"
@@ -1281,7 +1286,8 @@ Not-null constraints:
  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
+Child tables:
+    test_foreign_constraints_inh
 
 ALTER TABLE test_foreign_constraints DROP CONSTRAINT test_foreign_constraints_id1_fkey;
 \d+ test_foreign_constraints
@@ -1289,7 +1295,8 @@ ALTER TABLE test_foreign_constraints DROP CONSTRAINT test_foreign_constraints_id
  Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
 --------+---------+-----------+----------+---------+---------+--------------+-------------
  id1    | integer |           |          |         | plain   |              | 
-Child tables: test_foreign_constraints_inh
+Child tables:
+    test_foreign_constraints_inh
 
 \d+ test_foreign_constraints_inh
                        Table "public.test_foreign_constraints_inh"
@@ -2290,7 +2297,8 @@ Not-null constraints:
     "pp1_f1_not_null" NOT NULL "f1" (inherited)
     "nn" NOT NULL "a2"
 Inherits: pp1
-Child tables: cc2
+Child tables:
+    cc2
 
 \d+ cc2
                                          Table "public.cc2"
@@ -2315,8 +2323,9 @@ alter table pp1 alter column f1 set not null;
  f1     | integer |           | not null |         | plain   |              | 
 Not-null constraints:
     "pp1_f1_not_null" NOT NULL "f1"
-Child tables: cc1,
-              cc2
+Child tables:
+    cc1
+    cc2
 
 \d+ cc1
                                     Table "public.cc1"
@@ -2330,7 +2339,8 @@ Not-null constraints:
     "pp1_f1_not_null" NOT NULL "f1" (inherited)
     "nn" NOT NULL "a2"
 Inherits: pp1
-Child tables: cc2
+Child tables:
+    cc2
 
 \d+ cc2
                                          Table "public.cc2"
@@ -2373,7 +2383,8 @@ alter table cc1 alter column a2 drop not null;
 Not-null constraints:
     "pp1_f1_not_null" NOT NULL "f1" (inherited)
 Inherits: pp1
-Child tables: cc2
+Child tables:
+    cc2
 
 -- same for cc2
 alter table cc2 alter column f1 drop not null;
@@ -2402,8 +2413,9 @@ alter table pp1 alter column f1 drop not null;
  Column |  Type   | Collation | Nullable | Default | Storage | Stats target | Description 
 --------+---------+-----------+----------+---------+---------+--------------+-------------
  f1     | integer |           |          |         | plain   |              | 
-Child tables: cc1,
-              cc2
+Child tables:
+    cc1
+    cc2
 
 alter table pp1 add primary key (f1);
 -- Leave these tables around, for pg_upgrade testing
@@ -2572,8 +2584,9 @@ Inherits: inh_nn_parent
  a      | integer |           | not null |         | plain   |              | 
 Not-null constraints:
     "inh_nn_parent_a_not_null" NOT NULL "a" NO INHERIT
-Child tables: inh_nn_child,
-              inh_nn_child2
+Child tables:
+    inh_nn_child
+    inh_nn_child2
 
 drop table inh_nn_parent, inh_nn_child, inh_nn_child2;
 CREATE TABLE inh_nn_parent (a int, NOT NULL a NO INHERIT);
@@ -2632,7 +2645,8 @@ alter table inh_parent alter column f1 set not null;
  f1     | integer |           | not null |         | plain   |              | 
 Not-null constraints:
     "inh_parent_f1_not_null" NOT NULL "f1"
-Child tables: inh_child1
+Child tables:
+    inh_child1
 
 \d+ inh_child1
                                 Table "public.inh_child1"
@@ -2642,7 +2656,8 @@ Child tables: inh_child1
 Not-null constraints:
     "inh_child1_f1_not_null" NOT NULL "f1" (local, inherited)
 Inherits: inh_parent
-Child tables: inh_child2
+Child tables:
+    inh_child2
 
 \d+ inh_child2
                                 Table "public.inh_child2"
@@ -2685,8 +2700,9 @@ Not-null constraints:
  f1     | integer |           | not null |         | plain   |              | 
 Not-null constraints:
     "inh_child1_f1_not_null" NOT NULL "f1"
-Child tables: inh_child2,
-              inh_child3
+Child tables:
+    inh_child2
+    inh_child3
 
 \d+ inh_child2
                                 Table "public.inh_child2"
index cf4b5221a8da1ade7e445ba016b81d6a58e519af..75b8de79fce49d727272c3b3fb4b6531da83b335 100644 (file)
@@ -567,13 +567,14 @@ from hash_parted order by part;
  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'),
-            part_ee_ff FOR VALUES IN ('ee', 'ff'), PARTITIONED,
-            part_gg FOR VALUES IN ('gg'), PARTITIONED,
-            part_null FOR VALUES IN (NULL),
-            part_xx_yy FOR VALUES IN ('xx', 'yy'), PARTITIONED,
-            part_default DEFAULT, PARTITIONED
+Partitions:
+    part_aa_bb FOR VALUES IN ('aa', 'bb')
+    part_cc_dd FOR VALUES IN ('cc', 'dd')
+    part_ee_ff FOR VALUES IN ('ee', 'ff'), PARTITIONED
+    part_gg FOR VALUES IN ('gg'), PARTITIONED
+    part_null FOR VALUES IN (NULL)
+    part_xx_yy FOR VALUES IN ('xx', 'yy'), PARTITIONED
+    part_default DEFAULT, PARTITIONED
 
 -- cleanup
 drop table range_parted, list_parted;
@@ -972,14 +973,15 @@ create table mcrparted8_ge_d partition of mcrparted for values from ('d', minval
  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),
-            mcrparted3_c_to_common FOR VALUES FROM ('c', MINVALUE) TO ('common', MINVALUE),
-            mcrparted4_common_lt_0 FOR VALUES FROM ('common', MINVALUE) TO ('common', 0),
-            mcrparted5_common_0_to_10 FOR VALUES FROM ('common', 0) TO ('common', 10),
-            mcrparted6_common_ge_10 FOR VALUES FROM ('common', 10) TO ('common', MAXVALUE),
-            mcrparted7_gt_common_lt_d FOR VALUES FROM ('common', MAXVALUE) TO ('d', MINVALUE),
-            mcrparted8_ge_d FOR VALUES FROM ('d', MINVALUE) TO (MAXVALUE, MAXVALUE)
+Partitions:
+    mcrparted1_lt_b FOR VALUES FROM (MINVALUE, MINVALUE) TO ('b', MINVALUE)
+    mcrparted2_b FOR VALUES FROM ('b', MINVALUE) TO ('c', MINVALUE)
+    mcrparted3_c_to_common FOR VALUES FROM ('c', MINVALUE) TO ('common', MINVALUE)
+    mcrparted4_common_lt_0 FOR VALUES FROM ('common', MINVALUE) TO ('common', 0)
+    mcrparted5_common_0_to_10 FOR VALUES FROM ('common', 0) TO ('common', 10)
+    mcrparted6_common_ge_10 FOR VALUES FROM ('common', 10) TO ('common', MAXVALUE)
+    mcrparted7_gt_common_lt_d FOR VALUES FROM ('common', MAXVALUE) TO ('d', MINVALUE)
+    mcrparted8_ge_d FOR VALUES FROM ('d', MINVALUE) TO (MAXVALUE, MAXVALUE)
 
 \d+ mcrparted1_lt_b
                               Table "public.mcrparted1_lt_b"
index 4004efe0dacd0133146db553636b90801e75316a..13ca733f9fa493df903d1a38b3dbe56740832150 100644 (file)
@@ -138,10 +138,11 @@ SET search_path = partition_split_schema, public;
  salesperson_id | integer |           |          |         | plain   |              | 
  sales_date     | date    |           |          |         | plain   |              | 
 Partition key: RANGE (sales_date)
-Partitions: partition_split_schema2.sales_apr2022 FOR VALUES FROM ('04-01-2022') TO ('05-01-2022'),
-            partition_split_schema2.sales_feb2022 FOR VALUES FROM ('02-01-2022') TO ('03-01-2022'),
-            partition_split_schema2.sales_mar2022 FOR VALUES FROM ('03-01-2022') TO ('04-01-2022'),
-            sales_jan2022 FOR VALUES FROM ('01-01-2022') TO ('02-01-2022')
+Partitions:
+    partition_split_schema2.sales_apr2022 FOR VALUES FROM ('04-01-2022') TO ('05-01-2022')
+    partition_split_schema2.sales_feb2022 FOR VALUES FROM ('02-01-2022') TO ('03-01-2022')
+    partition_split_schema2.sales_mar2022 FOR VALUES FROM ('03-01-2022') TO ('04-01-2022')
+    sales_jan2022 FOR VALUES FROM ('01-01-2022') TO ('02-01-2022')
 
 DROP TABLE sales_range;
 DROP TABLE sales_others;
@@ -242,11 +243,12 @@ ALTER TABLE sales_range SPLIT PARTITION sales_feb_mar_apr2022 INTO
  sales_amount     | integer               |           |          |         | plain    |              | 
  sales_date       | date                  |           |          |         | plain    |              | 
 Partition key: RANGE (sales_date)
-Partitions: partition_split_schema2.sales_mar2022 FOR VALUES FROM ('03-01-2022') TO ('04-01-2022'),
-            sales_apr2022 FOR VALUES FROM ('04-01-2022') TO ('05-01-2022'),
-            sales_feb2022 FOR VALUES FROM ('02-01-2022') TO ('03-01-2022'),
-            sales_jan2022 FOR VALUES FROM ('01-01-2022') TO ('02-01-2022'),
-            sales_others DEFAULT
+Partitions:
+    partition_split_schema2.sales_mar2022 FOR VALUES FROM ('03-01-2022') TO ('04-01-2022')
+    sales_apr2022 FOR VALUES FROM ('04-01-2022') TO ('05-01-2022')
+    sales_feb2022 FOR VALUES FROM ('02-01-2022') TO ('03-01-2022')
+    sales_jan2022 FOR VALUES FROM ('01-01-2022') TO ('02-01-2022')
+    sales_others DEFAULT
 
 SELECT tableoid::regclass, * FROM sales_range ORDER BY tableoid::regclass::text COLLATE "C", salesperson_id;
                tableoid                | salesperson_id | salesperson_name | sales_amount | sales_date 
@@ -1317,7 +1319,8 @@ CREATE TABLE t_bigint_default PARTITION OF t_bigint DEFAULT;
  j      | integer |           |          | 101                                   | plain   |              | 
  k      | integer |           |          | generated always as ((b + 10)) stored | plain   |              | 
 Partition key: RANGE (b)
-Partitions: t_bigint_default DEFAULT
+Partitions:
+    t_bigint_default DEFAULT
 
 \d+ t_bigint_default
                                     Table "partition_split_schema.t_bigint_default"
index b9b8dde018f08f5223f616efbd7d2ab2274a5ade..336b04fa2788d842dd854c48bf82a9181f7fa5c5 100644 (file)
@@ -262,7 +262,8 @@ Indexes:
     "test_replica_identity4_pkey" PRIMARY KEY, btree (id) INVALID REPLICA IDENTITY
 Not-null constraints:
     "test_replica_identity4_id_not_null" NOT NULL "id"
-Partitions: test_replica_identity4_1 FOR VALUES IN (1)
+Partitions:
+    test_replica_identity4_1 FOR VALUES IN (1)
 
 ALTER INDEX test_replica_identity4_pkey
   ATTACH PARTITION test_replica_identity4_1_pkey;
@@ -276,7 +277,8 @@ Indexes:
     "test_replica_identity4_pkey" PRIMARY KEY, btree (id) REPLICA IDENTITY
 Not-null constraints:
     "test_replica_identity4_id_not_null" NOT NULL "id"
-Partitions: test_replica_identity4_1 FOR VALUES IN (1)
+Partitions:
+    test_replica_identity4_1 FOR VALUES IN (1)
 
 -- Dropping the primary key is not allowed if that would leave the replica
 -- identity as nullable
index 07d93e7def1ddf11a156178902ddf68bfc6f991b..3a5e82c35bd36b2ff8e3d0770df2ac3ae72e98e4 100644 (file)
@@ -1261,9 +1261,10 @@ Policies:
       USING ((cid < 55))
 Not-null constraints:
     "part_document_dlevel_not_null" NOT NULL "dlevel"
-Partitions: part_document_fiction FOR VALUES FROM (11) TO (12),
-            part_document_nonfiction FOR VALUES FROM (99) TO (100),
-            part_document_satire FOR VALUES FROM (55) TO (56)
+Partitions:
+    part_document_fiction FOR VALUES FROM (11) TO (12)
+    part_document_nonfiction FOR VALUES FROM (99) TO (100)
+    part_document_satire FOR VALUES FROM (55) TO (56)
 
 SELECT * FROM pg_policies WHERE schemaname = 'regress_rls_schema' AND tablename like '%part_document%' ORDER BY policyname;
      schemaname     |   tablename   | policyname | permissive  |       roles        | cmd |                    qual                    | with_check 
index 185880a3217a0a01409fb1e01dc45a7b6302d00a..f0dd25cdf0c28cef0d60bb4afb116e9cb8cdfbb7 100644 (file)
@@ -355,8 +355,9 @@ Number of partitions: 2 (Use \d+ to list them.)
 Partition key: LIST (a)
 Indexes:
     "part_a_idx" btree (a), tablespace "regress_tblspace"
-Partitions: testschema.part1 FOR VALUES IN (1),
-            testschema.part2 FOR VALUES IN (2)
+Partitions:
+    testschema.part1 FOR VALUES IN (1)
+    testschema.part2 FOR VALUES IN (2)
 
 \d testschema.part1
              Table "testschema.part1"
@@ -392,8 +393,9 @@ Tablespace: "regress_tblspace"
 --------+---------+------+------------+---------+--------------
  a      | integer | yes  | a          | plain   | 
 btree, for table "testschema.part"
-Partitions: testschema.part1_a_idx,
-            testschema.part2_a_idx
+Partitions:
+    testschema.part1_a_idx
+    testschema.part2_a_idx
 Tablespace: "regress_tblspace"
 
 -- partitioned rels cannot specify the default tablespace.  These fail: