Walker Farrow
Walker Farrow

Reputation: 3915

How to execute select row(*) in postgres

In postgres you can return a row as a single cell as in the following:

select row(date_created,created_By)
from some_table

However this does not work when you execute select row(*)

Does anybody know how to implement the row() function using asterisk so if my table changes in the future, I will not have to modify my query?

I am using Postgres version 8.4.1

Thank you.

Upvotes: 0

Views: 1005

Answers (1)

Vamsi Prabhala
Vamsi Prabhala

Reputation: 49260

You just need to prefix the * with the table-name or table-alias.

Documentation

select row(s.*)
from some_table s

Upvotes: 3

Related Questions