ezorita
ezorita

Reputation: 126

Unparsed row in pg-promise when specifying SELECT columns

Why does pg-promise return a parsed object when querying with SELECT * ..., but returns an unparsed row when select columns are specified SELECT (given_name, family_name, photo) ...?

Is there a way to tell pg-promise to parse the column names like in the first case?

Upvotes: 3

Views: 273

Answers (1)

vitaly-t
vitaly-t

Reputation: 25840

...returns an unparsed row when select columns are specified

You do not just specify columns, you place them into parenthesis, which tells PostgreSQL to return tuples, which is what you are getting. And if you run your query in pgAdmin, you will see the same.

Is there a way to tell pg-promise to parse the column names like in the first case?

Remove the parenthesis, and that's it.

Upvotes: 2

Related Questions