Fix Postgres, hopefully

This commit is contained in:
Neil Alexander 2021-04-16 13:20:53 +01:00
parent 45bcca2cb6
commit d369acf512
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -92,10 +92,8 @@ const bulkSelectStateEventByIDSQL = "" +
const bulkSelectStateEventByNIDSQL = "" +
"SELECT event_type_nid, event_state_key_nid, event_nid FROM roomserver_events" +
" WHERE event_nid = ANY($1)" +
//" AND event_type_nid = ANY($2)" +
//" AND event_state_key_nid = ANY($3)" +
" AND ($2::bigint[] IS NULL OR event_type_nid = ANY($2))" +
" AND ($3::bigint[] IS NULL OR event_state_key_nid = ANY($3))" +
" AND (CARDINALITY($2) = 0 OR event_type_nid = ANY($2))" +
" AND (CARDINALITY($3) = 0 OR event_state_key_nid = ANY($3))" +
" ORDER BY event_type_nid, event_state_key_nid ASC"
const bulkSelectStateAtEventByIDSQL = "" +