0

When using COPY to restore a CSV file, phppgadmin shows that the real database size(4GB) but when I choose to browse the table it shows Estimated row count to 0. I did a VACUUM ANALYZE. simple SELECT queries returns 0 rows, but the database size is 4GB. Also:

SELECT count(*) FROM tbl_data

return 0. Can anyone help?

Majid Azimi
  • 547
  • 1
  • 13
  • 29

2 Answers2

2

Because the estimated row count is just that -- an estimate. IIRC, the stats aren't updated until after the copy, and perhaps not after that (you might have to do a VACUUM ANALYZE first).

womble
  • 96,255
  • 29
  • 175
  • 230
1

I asked this question on PostgreSQL. They told:

COPY runs inside a transaction, so it is not visible to outside.

Majid Azimi
  • 547
  • 1
  • 13
  • 29