I don't understand why this result is possible. Can someone explain why the first assert returns true
and the second false
? generate_token()
is a function that generates a random bytea
and inserts it into a certain table, then the inserted row is returned. The function itself is working fine. Running through a .pgsql script.
DO $$
DECLARE
test record;
BEGIN
select * into test from generate_token('test');
--returns true
assert test.token IS NOT NULL;
--returns false, which breaks.
assert test IS NOT NULL;
END;$$;
generate_token()
(including the return type) would be instrumental for the question. And always your version of Postgres.