0

We have table "table1" containing 100000 rows, which includes blob data. The total table size is 3.5 GB.

When tried to extract all records into CSV/.txt file by using copy or \o commands the generated output file is 100 GB in size.

ex:

select pg_size_pretty(pg_total_relation_size('table1));
    3.5 GB

Please let us know how this actually generated this much huge size and how will get know the actual table size?

Ram
  • 199
  • 1
  • 2
  • 18
  • Take a look here https://stackoverflow.com/questions/41991380/whats-the-difference-between-pg-table-size-pg-relation-size-pg-total-relatio – Óscar Andreu Apr 02 '20 at 06:38
  • What exactly do you mean by "blob data", and how exactly did you export the data? – Laurenz Albe Apr 02 '20 at 06:44
  • Assuming your "blob data" is a `bytea`, then this could be explained by Postgres compression of those values. Also `bytea` will be hex encoded in the output, meaning a single byte will be converted to two characters –  Apr 02 '20 at 06:56

0 Answers0