Display "replica identity" only for \d plus mode, exclude system schema
objects, and display all possible values, not just non-default,
non-index ones.
printTableAddFooter(&cont, buf.data);
}
printTableAddFooter(&cont, buf.data);
}
- if ((tableinfo.relkind == 'r' || tableinfo.relkind == 'm') &&
- tableinfo.relreplident != 'd' && tableinfo.relreplident != 'i')
+ if (verbose && (tableinfo.relkind == 'r' || tableinfo.relkind == 'm') &&
+ strcmp(schemaname, "pg_catalog") != 0)
{
const char *s = _("Replica Identity");
printfPQExpBuffer(&buf, "%s: %s",
s,
{
const char *s = _("Replica Identity");
printfPQExpBuffer(&buf, "%s: %s",
s,
- tableinfo.relreplident == 'n' ? "NOTHING" : "FULL");
+ tableinfo.relreplident == 'd' ? "DEFAULT" :
+ tableinfo.relreplident == 'f' ? "FULL" :
+ tableinfo.relreplident == 'i' ? "USING INDEX" :
+ tableinfo.relreplident == 'n' ? "NOTHING" :
+ "???");
+
printTableAddFooter(&cont, buf.data);
}
printTableAddFooter(&cont, buf.data);
}
a | text | not null | main | |
b | text | | extended | |
c | text | | external | |
a | text | not null | main | |
b | text | | extended | |
c | text | | external | |
+Replica Identity: DEFAULT
Has OIDs: no
CREATE TABLE ctlt12_comments (LIKE ctlt1 INCLUDING COMMENTS, LIKE ctlt2 INCLUDING COMMENTS);
Has OIDs: no
CREATE TABLE ctlt12_comments (LIKE ctlt1 INCLUDING COMMENTS, LIKE ctlt2 INCLUDING COMMENTS);
a | text | not null | extended | | A
b | text | | extended | | B
c | text | | extended | | C
a | text | not null | extended | | A
b | text | | extended | | B
c | text | | extended | | C
+Replica Identity: DEFAULT
Has OIDs: no
CREATE TABLE ctlt1_inh (LIKE ctlt1 INCLUDING CONSTRAINTS INCLUDING COMMENTS) INHERITS (ctlt1);
Has OIDs: no
CREATE TABLE ctlt1_inh (LIKE ctlt1 INCLUDING CONSTRAINTS INCLUDING COMMENTS) INHERITS (ctlt1);
Check constraints:
"ctlt1_a_check" CHECK (length(a) > 2)
Inherits: ctlt1
Check constraints:
"ctlt1_a_check" CHECK (length(a) > 2)
Inherits: ctlt1
+Replica Identity: DEFAULT
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;
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;
"ctlt3_a_check" CHECK (length(a) < 5)
Inherits: ctlt1,
ctlt3
"ctlt3_a_check" CHECK (length(a) < 5)
Inherits: ctlt1,
ctlt3
+Replica Identity: DEFAULT
Has OIDs: no
CREATE TABLE ctlt13_like (LIKE ctlt3 INCLUDING CONSTRAINTS INCLUDING COMMENTS INCLUDING STORAGE) INHERITS (ctlt1);
Has OIDs: no
CREATE TABLE ctlt13_like (LIKE ctlt3 INCLUDING CONSTRAINTS INCLUDING COMMENTS INCLUDING STORAGE) INHERITS (ctlt1);
"ctlt1_a_check" CHECK (length(a) > 2)
"ctlt3_a_check" CHECK (length(a) < 5)
Inherits: ctlt1
"ctlt1_a_check" CHECK (length(a) > 2)
"ctlt3_a_check" CHECK (length(a) < 5)
Inherits: ctlt1
+Replica Identity: DEFAULT
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;
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;
"ctlt_all_expr_idx" btree ((a || b))
Check constraints:
"ctlt1_a_check" CHECK (length(a) > 2)
"ctlt_all_expr_idx" btree ((a || b))
Check constraints:
"ctlt1_a_check" CHECK (length(a) > 2)
+Replica Identity: DEFAULT
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;
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;
dd | integer | | plain | |
Inherits: inht1,
inhs1
dd | integer | | plain | |
Inherits: inht1,
inhs1
+Replica Identity: DEFAULT
Has OIDs: no
DROP TABLE inhts;
Has OIDs: no
DROP TABLE inhts;
z | integer | | plain | |
Inherits: inht2,
inht3
z | integer | | plain | |
Inherits: inht2,
inht3
+Replica Identity: DEFAULT
Has OIDs: no
CREATE TABLE inhts (d int) INHERITS (inht2, inhs1);
Has OIDs: no
CREATE TABLE inhts (d int) INHERITS (inht2, inhs1);
d | integer | | plain | |
Inherits: inht2,
inhs1
d | integer | | plain | |
Inherits: inht2,
inhs1
+Replica Identity: DEFAULT
Has OIDs: no
WITH RECURSIVE r AS (
Has OIDs: no
WITH RECURSIVE r AS (
Indexes:
"test_constraints_val1_val2_key" UNIQUE CONSTRAINT, btree (val1, val2)
Child tables: test_constraints_inh
Indexes:
"test_constraints_val1_val2_key" UNIQUE CONSTRAINT, btree (val1, val2)
Child tables: test_constraints_inh
+Replica Identity: DEFAULT
Has OIDs: no
ALTER TABLE ONLY test_constraints DROP CONSTRAINT test_constraints_val1_val2_key;
Has OIDs: no
ALTER TABLE ONLY test_constraints DROP CONSTRAINT test_constraints_val1_val2_key;
val1 | character varying | | extended | |
val2 | integer | | plain | |
Child tables: test_constraints_inh
val1 | character varying | | extended | |
val2 | integer | | plain | |
Child tables: test_constraints_inh
+Replica Identity: DEFAULT
Has OIDs: no
\d+ test_constraints_inh
Has OIDs: no
\d+ test_constraints_inh
val1 | character varying | | extended | |
val2 | integer | | plain | |
Inherits: test_constraints
val1 | character varying | | extended | |
val2 | integer | | plain | |
Inherits: test_constraints
+Replica Identity: DEFAULT
Has OIDs: no
DROP TABLE test_constraints_inh;
Has OIDs: no
DROP TABLE test_constraints_inh;
Indexes:
"test_ex_constraints_c_excl" EXCLUDE USING gist (c WITH &&)
Child tables: test_ex_constraints_inh
Indexes:
"test_ex_constraints_c_excl" EXCLUDE USING gist (c WITH &&)
Child tables: test_ex_constraints_inh
+Replica Identity: DEFAULT
Has OIDs: no
ALTER TABLE test_ex_constraints DROP CONSTRAINT test_ex_constraints_c_excl;
Has OIDs: no
ALTER TABLE test_ex_constraints DROP CONSTRAINT test_ex_constraints_c_excl;
--------+--------+-----------+---------+--------------+-------------
c | circle | | plain | |
Child tables: test_ex_constraints_inh
--------+--------+-----------+---------+--------------+-------------
c | circle | | plain | |
Child tables: test_ex_constraints_inh
+Replica Identity: DEFAULT
Has OIDs: no
\d+ test_ex_constraints_inh
Has OIDs: no
\d+ test_ex_constraints_inh
--------+--------+-----------+---------+--------------+-------------
c | circle | | plain | |
Inherits: test_ex_constraints
--------+--------+-----------+---------+--------------+-------------
c | circle | | plain | |
Inherits: test_ex_constraints
+Replica Identity: DEFAULT
Has OIDs: no
DROP TABLE test_ex_constraints_inh;
Has OIDs: no
DROP TABLE test_ex_constraints_inh;
"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)
"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)
+Replica Identity: DEFAULT
Has OIDs: no
\d+ test_foreign_constraints
Has OIDs: no
\d+ test_foreign_constraints
Foreign-key constraints:
"test_foreign_constraints_id1_fkey" FOREIGN KEY (id1) REFERENCES test_primary_constraints(id)
Child tables: test_foreign_constraints_inh
Foreign-key constraints:
"test_foreign_constraints_id1_fkey" FOREIGN KEY (id1) REFERENCES test_primary_constraints(id)
Child tables: test_foreign_constraints_inh
+Replica Identity: DEFAULT
Has OIDs: no
ALTER TABLE test_foreign_constraints DROP CONSTRAINT test_foreign_constraints_id1_fkey;
Has OIDs: no
ALTER TABLE test_foreign_constraints DROP CONSTRAINT test_foreign_constraints_id1_fkey;
--------+---------+-----------+---------+--------------+-------------
id1 | integer | | plain | |
Child tables: test_foreign_constraints_inh
--------+---------+-----------+---------+--------------+-------------
id1 | integer | | plain | |
Child tables: test_foreign_constraints_inh
+Replica Identity: DEFAULT
Has OIDs: no
\d+ test_foreign_constraints_inh
Has OIDs: no
\d+ test_foreign_constraints_inh
--------+---------+-----------+---------+--------------+-------------
id1 | integer | | plain | |
Inherits: test_foreign_constraints
--------+---------+-----------+---------+--------------+-------------
id1 | integer | | plain | |
Inherits: test_foreign_constraints
+Replica Identity: DEFAULT
Has OIDs: no
DROP TABLE test_foreign_constraints_inh;
Has OIDs: no
DROP TABLE test_foreign_constraints_inh;
tv.totamt
FROM tv
ORDER BY tv.type;
tv.totamt
FROM tv
ORDER BY tv.type;
+Replica Identity: DEFAULT
\d+ tvm
Materialized view "public.tvm"
\d+ tvm
Materialized view "public.tvm"
tv.totamt
FROM tv
ORDER BY tv.type;
tv.totamt
FROM tv
ORDER BY tv.type;
+Replica Identity: DEFAULT
\d+ tvvm
Materialized view "public.tvvm"
\d+ tvvm
Materialized view "public.tvvm"
View definition:
SELECT tvv.grandtot
FROM tvv;
View definition:
SELECT tvv.grandtot
FROM tvv;
+Replica Identity: DEFAULT
\d+ bb
Materialized view "public.bb"
\d+ bb
Materialized view "public.bb"
View definition:
SELECT tvvmv.grandtot
FROM tvvmv;
View definition:
SELECT tvvmv.grandtot
FROM tvvmv;
+Replica Identity: DEFAULT
-- test schema behavior
CREATE SCHEMA mvschema;
-- test schema behavior
CREATE SCHEMA mvschema;
View definition:
SELECT sum(tvm.totamt) AS grandtot
FROM mvschema.tvm;
View definition:
SELECT sum(tvm.totamt) AS grandtot
FROM mvschema.tvm;
+Replica Identity: DEFAULT
SET search_path = mvschema, public;
\d+ tvm
SET search_path = mvschema, public;
\d+ tvm
tv.totamt
FROM tv
ORDER BY tv.type;
tv.totamt
FROM tv
ORDER BY tv.type;
+Replica Identity: DEFAULT
-- modify the underlying table data
INSERT INTO t VALUES (6, 'z', 13);
-- modify the underlying table data
INSERT INTO t VALUES (6, 'z', 13);
SELECT v_test2.moo,
3 * v_test2.moo
FROM v_test2;
SELECT v_test2.moo,
3 * v_test2.moo
FROM v_test2;
+Replica Identity: DEFAULT
CREATE MATERIALIZED VIEW mv_test3 AS SELECT * FROM mv_test2 WHERE moo = 12345;
SELECT relispopulated FROM pg_class WHERE oid = 'mv_test3'::regclass;
CREATE MATERIALIZED VIEW mv_test3 AS SELECT * FROM mv_test2 WHERE moo = 12345;
SELECT relispopulated FROM pg_class WHERE oid = 'mv_test3'::regclass;
"test_replica_identity_unique_nondefer" UNIQUE CONSTRAINT, btree (keya, keyb)
"test_replica_identity_hash" hash (nonkey)
"test_replica_identity_keyab" btree (keya, keyb)
"test_replica_identity_unique_nondefer" UNIQUE CONSTRAINT, btree (keya, keyb)
"test_replica_identity_hash" hash (nonkey)
"test_replica_identity_keyab" btree (keya, keyb)
ALTER TABLE test_replica_identity REPLICA IDENTITY NOTHING;
SELECT relreplident FROM pg_class WHERE oid = 'test_replica_identity'::regclass;
ALTER TABLE test_replica_identity REPLICA IDENTITY NOTHING;
SELECT relreplident FROM pg_class WHERE oid = 'test_replica_identity'::regclass;
r3 AS
ON DELETE TO rules_src DO
NOTIFY rules_src_deletion
r3 AS
ON DELETE TO rules_src DO
NOTIFY rules_src_deletion
+Replica Identity: DEFAULT