mirror of
https://github.com/block/buzz.git
synced 2026-10-31 22:41:12 +00:00
fix(buzz-db): parenthesize ->> before COLLATE in NIP-43 drift query
COLLATE binds tighter than ->>, so `tag->>2 COLLATE "C"` parsed as `tag ->> (2 COLLATE "C")` and Postgres rejected the whole query with "collations are not supported by type integer". Every reconcile pass failed and no kind:13534 snapshot was ever repaired. Found by live E2E on Postgres 17. Signed-off-by: Elrond <28d6302a099e5225b02c4155ac4236e4912603df2ab08dbfc2f4fef08ce598c8@buzz.block.builderlab.xyz>
This commit is contained in:
@@ -183,7 +183,7 @@ async fn nip43_membership_snapshot_drift(
|
||||
SELECT COALESCE(
|
||||
jsonb_agg(
|
||||
jsonb_build_array(lower(tag->>1), tag->>2)
|
||||
ORDER BY lower(tag->>1) COLLATE "C", tag->>2 COLLATE "C"
|
||||
ORDER BY lower(tag->>1) COLLATE "C", (tag->>2) COLLATE "C"
|
||||
),
|
||||
'[]'::jsonb
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user