I'm wondering what the heck is wrong with this?
CREATE OR REPLACE FUNCTION maxNumber(int4)
RETURNS int4 AS $$
DECLARE
v_year ALIAS FOR $1;
BEGIN
RETURN (
SELECT count(*)
FROM table
WHERE stringcol ~ '[0-9]{2,3}.[0-9]{1,3}.v_year.[0-9]{1,3}'
);
END;
$$ LANGUAGE 'plpgsql' VOLATILE;
It always returns 0. The SQL itself seems to work. Thanks.
.
as\\.
– vks 17 hours ago