is it possible to return multiple rows with a post...
# off-topic
p
is it possible to return multiple rows with a postgres function rpc call? i only see the single record type
s
Please move the conversation here
The article that you linked to is doing exactly what you are after, not sure what's not working for you? also the article is making use of a function when it would have been better to use a view.
p
i couldn't get it to work using tablesample my function looks like this:
Copy code
BEGIN
    SELECT array_to_json(array_agg(row_to_json(t)))
    FROM (
      SELECT name 
      FROM hashtag
      TABLESAMPLE extensions.system_rows(25)
    )t;
END;
i'm getting this error atm
Copy code
If you want to discard the results of a SELECT, use PERFORM instead.
s
That's a syntax error. Try doing:
Copy code
sql
RETURN QUERY SELECT array_to_json...