I have this function to be created, but the variable view_sizeis being treated as a column.
I’m getting an error saying that column view_size don't exists.
Why?
If I change the context, it works (example: only do a query, is treated like a variable).
CREATE OR REPLACE FUNCTION create_view(view_size INTEGER) RETURNS VOID
AS $$
BEGIN
CREATE VIEW token_relation
AS
SELECT * FROM textblockhastoken
ORDER BY textblockid, sentence, position
LIMIT view_size;
END
$$
LANGUAGE plpgsql;
Try this instead: