-- Make sure we can create an exclusion constraint -- across a partitioned table. -- That code looks at strategy numbers that can differ in regular gist vs btree_gist, -- so we want to make sure it works here too. createtable parttmp (
id int,
valid_at daterange,
exclude using gist (id with =, valid_at with &&)
) partition by range (id);
createtable parttmp_1_to_10 partition of parttmp forvaluesfrom (1) to (10); createtable parttmp_11_to_20 partition of parttmp forvaluesfrom (11) to (20);
select * from parttmp orderby id, valid_at; select * from parttmp_1_to_10 orderby id, valid_at; select * from parttmp_11_to_20 orderby id, valid_at;
update parttmp set valid_at = valid_at * '[2000-01-15,2000-02-15)'where id = 1;
select * from parttmp orderby id, valid_at; select * from parttmp_1_to_10 orderby id, valid_at; select * from parttmp_11_to_20 orderby id, valid_at;
-- make sure the excluson constraint excludes: insertinto parttmp (id, valid_at) values
(2, '[2000-01-15, 2000-02-01)');
droptable parttmp;
-- should fail with a good error message: createtable parttmp (id int, valid_at daterange, exclude using gist (id with <>, valid_at with &&)) partition by range (id);
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-08-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.