-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
Description
To make names unique for partial indexes, hpqtypes-extras
hashes the WHERE
clause and appends it to the name. PostgreSQL has a hard upper limit for identifiers set to 63 characters, cf. the manual. Now, since take 63
is done after processing the whole name, we could end up dropping the hash altogether; suppose the hash is deadbeef
and witness:
psql> create index idx__some_long_table_name__some_column_with_a_really_long_name__deadbeef on some_long_table_name (some_column_with_a_really_long_name) where $CONDITION;
NOTICE: identifier "idx__some_table__some_column_with_a_really_long_name__deadbeef" will be truncated to "idx__some_long_table_name__some_column_with_a_really_long_name_"
CREATE INDEX
It would thus be impossible to have hpqtypes-extras
define two indexes differing only in the condition for partiality (i.e. differing only in the WHERE
clause).