ERROR: array must not contain nulls
Hello! RUM extension works as expected until today. All queries stop working because of NULL in data and in JOIN clause (req.allowed_in_country set to NULL in one row).
ERROR: array must not contain nulls
SQL fragment:
LEFT JOIN "context_country_visitor" cv ON (array[req.allowed_in_country] && cv.countries)
My first approach doesn't work (the same error)
LEFT JOIN "context_country_visitor" cv ON (req.allowed_in_country is not null AND array[req.allowed_in_country] && cv.countries)
How to force not to assign any row from context_country_visitor if allowed_in_country is NULL without error?
Index definition:
CREATE INDEX context_country_visitor_countries ON "context_country_visitor" USING rum (countries rum_anyarray_ops);
Types:
req.allowed_in_country character varying;
cv.countries character varying[];
Thanks!
It is worth saying that without an index all queries work as expected
Hello Artur,
Thank you for the issue! Can you send versions of RUM and PostgreSQL?
Array support was added in 1.2.0 version. And this check for NULL values within array was there. And I see this error "array must not contain nulls" with pg 10.0 and RUM 1.2.0. For example:
=# SELECT * FROM test_array WHERE i && '{NULL}';
ERROR: array must not contain nulls