0

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.

1
  • Why don't you just use select *? What is the real problem you are trying to solve here? Also: Postgres 8.4 is no longer maintained, you should really plan an upgrade to a supported version as soon as possible (at least use the latest minor version which is 8.4.22) Commented May 2, 2016 at 17:32

1 Answer 1

3

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

Documentation

select row(s.*)
from some_table s
Sign up to request clarification or add additional context in comments.

1 Comment

Genius! Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.