Return a table from a function - Mailing list pgsql-novice

From Simon Connah
Subject Return a table from a function
Date
Msg-id b6uFTyH937VOq3XGPT7xAS9Po7-3kwphF834W8eNTl4od008FNoSKn7HPlQnUooaVdk0t1ATa3b6PxJFh3pqF87VTLNJ82VTUXhMkjEqsAs=@protonmail.com
Whole thread Raw
Responses Re: Return a table from a function  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-novice
Hi,

I've written a function that returns a table. It works fine and I get the expected results. The only problem is that in
Node.jswhich is the client the table data is a string rather than a list of variables. Is there some way to change the
returndata so it is still like a table but in something like JSON? Or even better is there a way to return it as the
individualrows so that each column can be easily accessed? I'm using pg-promise to access PostgreSQL from a Node.js web
application.

Simon.


Attachment

pgsql-novice by date:

Previous
From: Peter Wright
Date:
Subject: Restricting certain users from accessing PUBLIC resources
Next
From: Laurenz Albe
Date:
Subject: Re: Return a table from a function