Schema check: the collation alias is not a reserved word

`collation` is reserved in Postgres, so the key check's query failed with
42601 on every database and every start refused. The live block showed it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-30 20:58:29 +02:00
commit eff5098c23

View file

@ -453,9 +453,9 @@ export class PostgresStore implements HeimdallStore {
WHERE key.position <= i.indnkeyatts
) = required.columns
AND NOT EXISTS (
SELECT 1 FROM unnest(i.indcollation::oid[]) WITH ORDINALITY AS collation(oid, position)
JOIN pg_collation c ON c.oid = collation.oid
WHERE collation.position <= i.indnkeyatts AND NOT c.collisdeterministic
SELECT 1 FROM unnest(i.indcollation::oid[]) WITH ORDINALITY AS key_collation(oid, position)
JOIN pg_collation c ON c.oid = key_collation.oid
WHERE key_collation.position <= i.indnkeyatts AND NOT c.collisdeterministic
)
UNION ALL
SELECT 'privilege', NULL, NULL, NULL