For instance I want to count null fields for each row in a table.
What argument type declaration should I use?
I tried composite type (table name as a type):
CREATE FUNCTION count_null (row my_table)
RETURNS INTEGER
AS $$
return len([x for x in row if x is None])
$$ LANGUAGE plpythonu;
But it doesn't match argument type if I call it like:
SELECT count_null(*) FROM my_table;