On 10/11/23 05:47, Paul Jungwirth wrote:
+SELECT pg_get_indexdef(conindid, 0, true) FROM pg_constraint WHERE
conname = 'temporal_rng_pk';
+ pg_get_indexdef
+-------------------------------------------------------------------------------
+ CREATE UNIQUE INDEX temporal_rng_pk ON temporal_rng USING gist (id,
valid_at)
Shouldn't this somehow show the operator classes for the columns? We
are using different operator classes for the id and valid_at columns,
aren't we?
We only print the operator classes if they are not the default, so they
don't appear here.
I do suspect something more is desirable though. For exclusion
constraints we replace everything before the columns with just "EXCLUDE
USING gist". I could embed WITHOUT OVERLAPS but it's not valid syntax in
CREATE INDEX. Let me know if you have any ideas.
Why not? The standard does not mention indexes (although some
discussions last week might change that) so we can change the syntax for
it as we wish. Doing so would also allow us to use ALTER TABLE ...
USING INDEX for such things.
--
Vik Fearing