mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-02 21:26:49 +02:00
psql: display "Replica Identity" only for FULL and NOTHING
INDEX is already displayed on the index, and we now exclude pg_catalog. DEFAULT is not displayed.
This commit is contained in:
parent
62215de292
commit
9d66116444
@ -345,7 +345,6 @@ WITH (user_catalog_table = true)
|
|||||||
options | text[] | | extended | |
|
options | text[] | | extended | |
|
||||||
Indexes:
|
Indexes:
|
||||||
"replication_metadata_pkey" PRIMARY KEY, btree (id)
|
"replication_metadata_pkey" PRIMARY KEY, btree (id)
|
||||||
Replica Identity: DEFAULT
|
|
||||||
Has OIDs: no
|
Has OIDs: no
|
||||||
Options: user_catalog_table=true
|
Options: user_catalog_table=true
|
||||||
|
|
||||||
@ -361,7 +360,6 @@ ALTER TABLE replication_metadata RESET (user_catalog_table);
|
|||||||
options | text[] | | extended | |
|
options | text[] | | extended | |
|
||||||
Indexes:
|
Indexes:
|
||||||
"replication_metadata_pkey" PRIMARY KEY, btree (id)
|
"replication_metadata_pkey" PRIMARY KEY, btree (id)
|
||||||
Replica Identity: DEFAULT
|
|
||||||
Has OIDs: no
|
Has OIDs: no
|
||||||
|
|
||||||
INSERT INTO replication_metadata(relation, options)
|
INSERT INTO replication_metadata(relation, options)
|
||||||
@ -376,7 +374,6 @@ ALTER TABLE replication_metadata SET (user_catalog_table = true);
|
|||||||
options | text[] | | extended | |
|
options | text[] | | extended | |
|
||||||
Indexes:
|
Indexes:
|
||||||
"replication_metadata_pkey" PRIMARY KEY, btree (id)
|
"replication_metadata_pkey" PRIMARY KEY, btree (id)
|
||||||
Replica Identity: DEFAULT
|
|
||||||
Has OIDs: no
|
Has OIDs: no
|
||||||
Options: user_catalog_table=true
|
Options: user_catalog_table=true
|
||||||
|
|
||||||
@ -397,7 +394,6 @@ ALTER TABLE replication_metadata SET (user_catalog_table = false);
|
|||||||
rewritemeornot | integer | | plain | |
|
rewritemeornot | integer | | plain | |
|
||||||
Indexes:
|
Indexes:
|
||||||
"replication_metadata_pkey" PRIMARY KEY, btree (id)
|
"replication_metadata_pkey" PRIMARY KEY, btree (id)
|
||||||
Replica Identity: DEFAULT
|
|
||||||
Has OIDs: no
|
Has OIDs: no
|
||||||
Options: user_catalog_table=false
|
Options: user_catalog_table=false
|
||||||
|
|
||||||
|
@ -2345,16 +2345,19 @@ describeOneTableDetails(const char *schemaname,
|
|||||||
printTableAddFooter(&cont, buf.data);
|
printTableAddFooter(&cont, buf.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (verbose && (tableinfo.relkind == 'r' || tableinfo.relkind == 'm') &&
|
if ((tableinfo.relkind == 'r' || tableinfo.relkind == 'm') &&
|
||||||
|
/*
|
||||||
|
* No need to display default values; we already display a
|
||||||
|
* REPLICA IDENTITY marker on indexes.
|
||||||
|
*/
|
||||||
|
tableinfo.relreplident != 'd' && tableinfo.relreplident != 'i' &&
|
||||||
strcmp(schemaname, "pg_catalog") != 0)
|
strcmp(schemaname, "pg_catalog") != 0)
|
||||||
{
|
{
|
||||||
const char *s = _("Replica Identity");
|
const char *s = _("Replica Identity");
|
||||||
|
|
||||||
printfPQExpBuffer(&buf, "%s: %s",
|
printfPQExpBuffer(&buf, "%s: %s",
|
||||||
s,
|
s,
|
||||||
tableinfo.relreplident == 'd' ? "DEFAULT" :
|
|
||||||
tableinfo.relreplident == 'f' ? "FULL" :
|
tableinfo.relreplident == 'f' ? "FULL" :
|
||||||
tableinfo.relreplident == 'i' ? "USING INDEX" :
|
|
||||||
tableinfo.relreplident == 'n' ? "NOTHING" :
|
tableinfo.relreplident == 'n' ? "NOTHING" :
|
||||||
"???");
|
"???");
|
||||||
|
|
||||||
|
@ -115,7 +115,6 @@ CREATE TABLE ctlt12_storage (LIKE ctlt1 INCLUDING STORAGE, LIKE ctlt2 INCLUDING
|
|||||||
a | text | not null | main | |
|
a | text | not null | main | |
|
||||||
b | text | | extended | |
|
b | text | | extended | |
|
||||||
c | text | | external | |
|
c | text | | external | |
|
||||||
Replica Identity: DEFAULT
|
|
||||||
Has OIDs: no
|
Has OIDs: no
|
||||||
|
|
||||||
CREATE TABLE ctlt12_comments (LIKE ctlt1 INCLUDING COMMENTS, LIKE ctlt2 INCLUDING COMMENTS);
|
CREATE TABLE ctlt12_comments (LIKE ctlt1 INCLUDING COMMENTS, LIKE ctlt2 INCLUDING COMMENTS);
|
||||||
@ -126,7 +125,6 @@ CREATE TABLE ctlt12_comments (LIKE ctlt1 INCLUDING COMMENTS, LIKE ctlt2 INCLUDIN
|
|||||||
a | text | not null | extended | | A
|
a | text | not null | extended | | A
|
||||||
b | text | | extended | | B
|
b | text | | extended | | B
|
||||||
c | text | | extended | | C
|
c | text | | extended | | C
|
||||||
Replica Identity: DEFAULT
|
|
||||||
Has OIDs: no
|
Has OIDs: no
|
||||||
|
|
||||||
CREATE TABLE ctlt1_inh (LIKE ctlt1 INCLUDING CONSTRAINTS INCLUDING COMMENTS) INHERITS (ctlt1);
|
CREATE TABLE ctlt1_inh (LIKE ctlt1 INCLUDING CONSTRAINTS INCLUDING COMMENTS) INHERITS (ctlt1);
|
||||||
@ -142,7 +140,6 @@ NOTICE: merging constraint "ctlt1_a_check" with inherited definition
|
|||||||
Check constraints:
|
Check constraints:
|
||||||
"ctlt1_a_check" CHECK (length(a) > 2)
|
"ctlt1_a_check" CHECK (length(a) > 2)
|
||||||
Inherits: ctlt1
|
Inherits: ctlt1
|
||||||
Replica Identity: DEFAULT
|
|
||||||
Has OIDs: no
|
Has OIDs: no
|
||||||
|
|
||||||
SELECT description FROM pg_description, pg_constraint c WHERE classoid = 'pg_constraint'::regclass AND objoid = c.oid AND c.conrelid = 'ctlt1_inh'::regclass;
|
SELECT description FROM pg_description, pg_constraint c WHERE classoid = 'pg_constraint'::regclass AND objoid = c.oid AND c.conrelid = 'ctlt1_inh'::regclass;
|
||||||
@ -165,7 +162,6 @@ Check constraints:
|
|||||||
"ctlt3_a_check" CHECK (length(a) < 5)
|
"ctlt3_a_check" CHECK (length(a) < 5)
|
||||||
Inherits: ctlt1,
|
Inherits: ctlt1,
|
||||||
ctlt3
|
ctlt3
|
||||||
Replica Identity: DEFAULT
|
|
||||||
Has OIDs: no
|
Has OIDs: no
|
||||||
|
|
||||||
CREATE TABLE ctlt13_like (LIKE ctlt3 INCLUDING CONSTRAINTS INCLUDING COMMENTS INCLUDING STORAGE) INHERITS (ctlt1);
|
CREATE TABLE ctlt13_like (LIKE ctlt3 INCLUDING CONSTRAINTS INCLUDING COMMENTS INCLUDING STORAGE) INHERITS (ctlt1);
|
||||||
@ -181,7 +177,6 @@ Check constraints:
|
|||||||
"ctlt1_a_check" CHECK (length(a) > 2)
|
"ctlt1_a_check" CHECK (length(a) > 2)
|
||||||
"ctlt3_a_check" CHECK (length(a) < 5)
|
"ctlt3_a_check" CHECK (length(a) < 5)
|
||||||
Inherits: ctlt1
|
Inherits: ctlt1
|
||||||
Replica Identity: DEFAULT
|
|
||||||
Has OIDs: no
|
Has OIDs: no
|
||||||
|
|
||||||
SELECT description FROM pg_description, pg_constraint c WHERE classoid = 'pg_constraint'::regclass AND objoid = c.oid AND c.conrelid = 'ctlt13_like'::regclass;
|
SELECT description FROM pg_description, pg_constraint c WHERE classoid = 'pg_constraint'::regclass AND objoid = c.oid AND c.conrelid = 'ctlt13_like'::regclass;
|
||||||
@ -203,7 +198,6 @@ Indexes:
|
|||||||
"ctlt_all_expr_idx" btree ((a || b))
|
"ctlt_all_expr_idx" btree ((a || b))
|
||||||
Check constraints:
|
Check constraints:
|
||||||
"ctlt1_a_check" CHECK (length(a) > 2)
|
"ctlt1_a_check" CHECK (length(a) > 2)
|
||||||
Replica Identity: DEFAULT
|
|
||||||
Has OIDs: no
|
Has OIDs: no
|
||||||
|
|
||||||
SELECT c.relname, objsubid, description FROM pg_description, pg_index i, pg_class c WHERE classoid = 'pg_class'::regclass AND objoid = i.indexrelid AND c.oid = i.indexrelid AND i.indrelid = 'ctlt_all'::regclass ORDER BY c.relname, objsubid;
|
SELECT c.relname, objsubid, description FROM pg_description, pg_index i, pg_class c WHERE classoid = 'pg_class'::regclass AND objoid = i.indexrelid AND c.oid = i.indexrelid AND i.indrelid = 'ctlt_all'::regclass ORDER BY c.relname, objsubid;
|
||||||
|
@ -913,7 +913,6 @@ ALTER TABLE inhts RENAME d TO dd;
|
|||||||
dd | integer | | plain | |
|
dd | integer | | plain | |
|
||||||
Inherits: inht1,
|
Inherits: inht1,
|
||||||
inhs1
|
inhs1
|
||||||
Replica Identity: DEFAULT
|
|
||||||
Has OIDs: no
|
Has OIDs: no
|
||||||
|
|
||||||
DROP TABLE inhts;
|
DROP TABLE inhts;
|
||||||
@ -935,7 +934,6 @@ ALTER TABLE inht1 RENAME aa TO aaa;
|
|||||||
z | integer | | plain | |
|
z | integer | | plain | |
|
||||||
Inherits: inht2,
|
Inherits: inht2,
|
||||||
inht3
|
inht3
|
||||||
Replica Identity: DEFAULT
|
|
||||||
Has OIDs: no
|
Has OIDs: no
|
||||||
|
|
||||||
CREATE TABLE inhts (d int) INHERITS (inht2, inhs1);
|
CREATE TABLE inhts (d int) INHERITS (inht2, inhs1);
|
||||||
@ -954,7 +952,6 @@ ERROR: cannot rename inherited column "b"
|
|||||||
d | integer | | plain | |
|
d | integer | | plain | |
|
||||||
Inherits: inht2,
|
Inherits: inht2,
|
||||||
inhs1
|
inhs1
|
||||||
Replica Identity: DEFAULT
|
|
||||||
Has OIDs: no
|
Has OIDs: no
|
||||||
|
|
||||||
WITH RECURSIVE r AS (
|
WITH RECURSIVE r AS (
|
||||||
@ -1002,7 +999,6 @@ CREATE TABLE test_constraints_inh () INHERITS (test_constraints);
|
|||||||
Indexes:
|
Indexes:
|
||||||
"test_constraints_val1_val2_key" UNIQUE CONSTRAINT, btree (val1, val2)
|
"test_constraints_val1_val2_key" UNIQUE CONSTRAINT, btree (val1, val2)
|
||||||
Child tables: test_constraints_inh
|
Child tables: test_constraints_inh
|
||||||
Replica Identity: DEFAULT
|
|
||||||
Has OIDs: no
|
Has OIDs: no
|
||||||
|
|
||||||
ALTER TABLE ONLY test_constraints DROP CONSTRAINT test_constraints_val1_val2_key;
|
ALTER TABLE ONLY test_constraints DROP CONSTRAINT test_constraints_val1_val2_key;
|
||||||
@ -1014,7 +1010,6 @@ ALTER TABLE ONLY test_constraints DROP CONSTRAINT test_constraints_val1_val2_key
|
|||||||
val1 | character varying | | extended | |
|
val1 | character varying | | extended | |
|
||||||
val2 | integer | | plain | |
|
val2 | integer | | plain | |
|
||||||
Child tables: test_constraints_inh
|
Child tables: test_constraints_inh
|
||||||
Replica Identity: DEFAULT
|
|
||||||
Has OIDs: no
|
Has OIDs: no
|
||||||
|
|
||||||
\d+ test_constraints_inh
|
\d+ test_constraints_inh
|
||||||
@ -1025,7 +1020,6 @@ Has OIDs: no
|
|||||||
val1 | character varying | | extended | |
|
val1 | character varying | | extended | |
|
||||||
val2 | integer | | plain | |
|
val2 | integer | | plain | |
|
||||||
Inherits: test_constraints
|
Inherits: test_constraints
|
||||||
Replica Identity: DEFAULT
|
|
||||||
Has OIDs: no
|
Has OIDs: no
|
||||||
|
|
||||||
DROP TABLE test_constraints_inh;
|
DROP TABLE test_constraints_inh;
|
||||||
@ -1043,7 +1037,6 @@ CREATE TABLE test_ex_constraints_inh () INHERITS (test_ex_constraints);
|
|||||||
Indexes:
|
Indexes:
|
||||||
"test_ex_constraints_c_excl" EXCLUDE USING gist (c WITH &&)
|
"test_ex_constraints_c_excl" EXCLUDE USING gist (c WITH &&)
|
||||||
Child tables: test_ex_constraints_inh
|
Child tables: test_ex_constraints_inh
|
||||||
Replica Identity: DEFAULT
|
|
||||||
Has OIDs: no
|
Has OIDs: no
|
||||||
|
|
||||||
ALTER TABLE test_ex_constraints DROP CONSTRAINT test_ex_constraints_c_excl;
|
ALTER TABLE test_ex_constraints DROP CONSTRAINT test_ex_constraints_c_excl;
|
||||||
@ -1053,7 +1046,6 @@ ALTER TABLE test_ex_constraints DROP CONSTRAINT test_ex_constraints_c_excl;
|
|||||||
--------+--------+-----------+---------+--------------+-------------
|
--------+--------+-----------+---------+--------------+-------------
|
||||||
c | circle | | plain | |
|
c | circle | | plain | |
|
||||||
Child tables: test_ex_constraints_inh
|
Child tables: test_ex_constraints_inh
|
||||||
Replica Identity: DEFAULT
|
|
||||||
Has OIDs: no
|
Has OIDs: no
|
||||||
|
|
||||||
\d+ test_ex_constraints_inh
|
\d+ test_ex_constraints_inh
|
||||||
@ -1062,7 +1054,6 @@ Has OIDs: no
|
|||||||
--------+--------+-----------+---------+--------------+-------------
|
--------+--------+-----------+---------+--------------+-------------
|
||||||
c | circle | | plain | |
|
c | circle | | plain | |
|
||||||
Inherits: test_ex_constraints
|
Inherits: test_ex_constraints
|
||||||
Replica Identity: DEFAULT
|
|
||||||
Has OIDs: no
|
Has OIDs: no
|
||||||
|
|
||||||
DROP TABLE test_ex_constraints_inh;
|
DROP TABLE test_ex_constraints_inh;
|
||||||
@ -1080,7 +1071,6 @@ Indexes:
|
|||||||
"test_primary_constraints_pkey" PRIMARY KEY, btree (id)
|
"test_primary_constraints_pkey" PRIMARY KEY, btree (id)
|
||||||
Referenced by:
|
Referenced by:
|
||||||
TABLE "test_foreign_constraints" CONSTRAINT "test_foreign_constraints_id1_fkey" FOREIGN KEY (id1) REFERENCES test_primary_constraints(id)
|
TABLE "test_foreign_constraints" CONSTRAINT "test_foreign_constraints_id1_fkey" FOREIGN KEY (id1) REFERENCES test_primary_constraints(id)
|
||||||
Replica Identity: DEFAULT
|
|
||||||
Has OIDs: no
|
Has OIDs: no
|
||||||
|
|
||||||
\d+ test_foreign_constraints
|
\d+ test_foreign_constraints
|
||||||
@ -1091,7 +1081,6 @@ Has OIDs: no
|
|||||||
Foreign-key constraints:
|
Foreign-key constraints:
|
||||||
"test_foreign_constraints_id1_fkey" FOREIGN KEY (id1) REFERENCES test_primary_constraints(id)
|
"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
|
||||||
Replica Identity: DEFAULT
|
|
||||||
Has OIDs: no
|
Has OIDs: no
|
||||||
|
|
||||||
ALTER TABLE test_foreign_constraints DROP CONSTRAINT test_foreign_constraints_id1_fkey;
|
ALTER TABLE test_foreign_constraints DROP CONSTRAINT test_foreign_constraints_id1_fkey;
|
||||||
@ -1101,7 +1090,6 @@ ALTER TABLE test_foreign_constraints DROP CONSTRAINT test_foreign_constraints_id
|
|||||||
--------+---------+-----------+---------+--------------+-------------
|
--------+---------+-----------+---------+--------------+-------------
|
||||||
id1 | integer | | plain | |
|
id1 | integer | | plain | |
|
||||||
Child tables: test_foreign_constraints_inh
|
Child tables: test_foreign_constraints_inh
|
||||||
Replica Identity: DEFAULT
|
|
||||||
Has OIDs: no
|
Has OIDs: no
|
||||||
|
|
||||||
\d+ test_foreign_constraints_inh
|
\d+ test_foreign_constraints_inh
|
||||||
@ -1110,7 +1098,6 @@ Has OIDs: no
|
|||||||
--------+---------+-----------+---------+--------------+-------------
|
--------+---------+-----------+---------+--------------+-------------
|
||||||
id1 | integer | | plain | |
|
id1 | integer | | plain | |
|
||||||
Inherits: test_foreign_constraints
|
Inherits: test_foreign_constraints
|
||||||
Replica Identity: DEFAULT
|
|
||||||
Has OIDs: no
|
Has OIDs: no
|
||||||
|
|
||||||
DROP TABLE test_foreign_constraints_inh;
|
DROP TABLE test_foreign_constraints_inh;
|
||||||
|
@ -104,7 +104,6 @@ View definition:
|
|||||||
tv.totamt
|
tv.totamt
|
||||||
FROM tv
|
FROM tv
|
||||||
ORDER BY tv.type;
|
ORDER BY tv.type;
|
||||||
Replica Identity: DEFAULT
|
|
||||||
|
|
||||||
\d+ tvm
|
\d+ tvm
|
||||||
Materialized view "public.tvm"
|
Materialized view "public.tvm"
|
||||||
@ -117,7 +116,6 @@ View definition:
|
|||||||
tv.totamt
|
tv.totamt
|
||||||
FROM tv
|
FROM tv
|
||||||
ORDER BY tv.type;
|
ORDER BY tv.type;
|
||||||
Replica Identity: DEFAULT
|
|
||||||
|
|
||||||
\d+ tvvm
|
\d+ tvvm
|
||||||
Materialized view "public.tvvm"
|
Materialized view "public.tvvm"
|
||||||
@ -127,7 +125,6 @@ Replica Identity: DEFAULT
|
|||||||
View definition:
|
View definition:
|
||||||
SELECT tvv.grandtot
|
SELECT tvv.grandtot
|
||||||
FROM tvv;
|
FROM tvv;
|
||||||
Replica Identity: DEFAULT
|
|
||||||
|
|
||||||
\d+ bb
|
\d+ bb
|
||||||
Materialized view "public.bb"
|
Materialized view "public.bb"
|
||||||
@ -139,7 +136,6 @@ Indexes:
|
|||||||
View definition:
|
View definition:
|
||||||
SELECT tvvmv.grandtot
|
SELECT tvvmv.grandtot
|
||||||
FROM tvvmv;
|
FROM tvvmv;
|
||||||
Replica Identity: DEFAULT
|
|
||||||
|
|
||||||
-- test schema behavior
|
-- test schema behavior
|
||||||
CREATE SCHEMA mvschema;
|
CREATE SCHEMA mvschema;
|
||||||
@ -156,7 +152,6 @@ Indexes:
|
|||||||
View definition:
|
View definition:
|
||||||
SELECT sum(tvm.totamt) AS grandtot
|
SELECT sum(tvm.totamt) AS grandtot
|
||||||
FROM mvschema.tvm;
|
FROM mvschema.tvm;
|
||||||
Replica Identity: DEFAULT
|
|
||||||
|
|
||||||
SET search_path = mvschema, public;
|
SET search_path = mvschema, public;
|
||||||
\d+ tvm
|
\d+ tvm
|
||||||
@ -170,7 +165,6 @@ View definition:
|
|||||||
tv.totamt
|
tv.totamt
|
||||||
FROM tv
|
FROM tv
|
||||||
ORDER BY tv.type;
|
ORDER BY tv.type;
|
||||||
Replica Identity: DEFAULT
|
|
||||||
|
|
||||||
-- modify the underlying table data
|
-- modify the underlying table data
|
||||||
INSERT INTO t VALUES (6, 'z', 13);
|
INSERT INTO t VALUES (6, 'z', 13);
|
||||||
@ -375,7 +369,6 @@ UNION ALL
|
|||||||
SELECT v_test2.moo,
|
SELECT v_test2.moo,
|
||||||
3 * v_test2.moo
|
3 * v_test2.moo
|
||||||
FROM v_test2;
|
FROM v_test2;
|
||||||
Replica Identity: DEFAULT
|
|
||||||
|
|
||||||
CREATE MATERIALIZED VIEW mv_test3 AS SELECT * FROM mv_test2 WHERE moo = 12345;
|
CREATE MATERIALIZED VIEW mv_test3 AS SELECT * FROM mv_test2 WHERE moo = 12345;
|
||||||
SELECT relispopulated FROM pg_class WHERE oid = 'mv_test3'::regclass;
|
SELECT relispopulated FROM pg_class WHERE oid = 'mv_test3'::regclass;
|
||||||
|
@ -170,6 +170,7 @@ Indexes:
|
|||||||
"test_replica_identity_unique_nondefer" UNIQUE CONSTRAINT, btree (keya, keyb)
|
"test_replica_identity_unique_nondefer" UNIQUE CONSTRAINT, btree (keya, keyb)
|
||||||
"test_replica_identity_hash" hash (nonkey)
|
"test_replica_identity_hash" hash (nonkey)
|
||||||
"test_replica_identity_keyab" btree (keya, keyb)
|
"test_replica_identity_keyab" btree (keya, keyb)
|
||||||
|
Replica Identity: FULL
|
||||||
|
|
||||||
ALTER TABLE test_replica_identity REPLICA IDENTITY NOTHING;
|
ALTER TABLE test_replica_identity REPLICA IDENTITY NOTHING;
|
||||||
SELECT relreplident FROM pg_class WHERE oid = 'test_replica_identity'::regclass;
|
SELECT relreplident FROM pg_class WHERE oid = 'test_replica_identity'::regclass;
|
||||||
|
@ -2609,7 +2609,6 @@ Rules:
|
|||||||
r3 AS
|
r3 AS
|
||||||
ON DELETE TO rules_src DO
|
ON DELETE TO rules_src DO
|
||||||
NOTIFY rules_src_deletion
|
NOTIFY rules_src_deletion
|
||||||
Replica Identity: DEFAULT
|
|
||||||
Has OIDs: no
|
Has OIDs: no
|
||||||
|
|
||||||
--
|
--
|
||||||
|
Loading…
Reference in New Issue
Block a user