Postgres Vacuum problem

430 views
Skip to first unread message

Hung Phan

unread,
Dec 26, 2019, 8:30:35 AM12/26/19
to Google Cloud SQL discuss
Hi, 

I can't work with the database other than the "select" statement. When I update or edit the table or column data it reports an error like this:

ERROR: database is not accepting commands to avoid wraparound data loss in database "xxx"
HINT
: Stop the postmaster and vacuum that database in single-user mode.
You might also need to commit or roll back old prepared transactions.

Table information:
Screenshot from 2019-12-25 23-05-50.png















It has been running for over 10 hours but does not see anything happening:
Screenshot from 2019-12-25 23-22-55.pngScreenshot from 2019-12-25 23-25-12.png


How do I know when the "VACUUM table" statement completes? Can I truncate that table?

Thanks a lot
Hung

Julie (cloud platform support)

unread,
Dec 26, 2019, 12:26:07 PM12/26/19
to google-cloud...@googlegroups.com
The NULL values from the select * from pg_stat_progress_vacuum is a known issue which is why the are no visible results as to the progress of the vacuum. Please note that the process may be able to stopped with the function pg_cancel_backend(pid int) which cancels a backend's current query. You can execute this against another backend that has exactly the same role as the user calling the function. In all other cases, you must be a superuser which is not supported by Cloud SQL

It seems you can truncate the table which is probably faster then vacuuming to reclaim that disk space though it is unclear if you can do it while vacuuming on the table is occurring. 

Finally if the above options do not work I suggest opening a private issue tracker and provide your project id and the instance name of the effected instance but it is generally advised you try to either cancel/restart the vacuum yourself first. 
Reply all
Reply to author
Forward
0 new messages