1

For my select query:

SELECT pg_size_pretty(pg_total_relation_size('tablename'))

It returns result like following.

pg_size_pretty
 -----------
    24 kB
   (1 row)

I need only 24 kB as output.

1
  • 1
    I don't really understand what's the question here. Please clarify. Commented Oct 16, 2012 at 13:01

1 Answer 1

1

Use the --tuples-only flag to psql:

psql databasename --tuples-only -c "SELECT pg_size_pretty(pg_total_relation_size('tablename'));"
Sign up to request clarification or add additional context in comments.

Comments

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.