Maybe my custom settings are relevant. Here they are in a gist:
On Thu, Mar 17, 2016 at 11:47 AM Steve Kehlet <steve.kehlet@xxxxxxxxx> wrote:
Sorry, seems like such a noob problem, but I'm stumped. This is postgres 9.4.5. I'll post my custom settings if desired but I don't think they're needed.We recently had an issue where the autovacuumer wasn't starting because postgres couldn't resolve the hostname 'localhost' (we had bad perms on /etc/hosts). We're still working on getting that fixed on all affected boxes.In the meantime: today, one particular database unexpectedly stopped serving with this error:2016-03-17 12:31:52 EDT [5395]: [787-1] ERROR: database is not accepting commands to avoid wraparound data loss in database with OID 02016-03-17 12:31:52 EDT [5395]: [788-1] HINT: Stop the postmaster and vacuum that database in single-user mode.You might also need to commit or roll back old prepared transactions.What has me confused is I ran the following command to keep an eye on this, and it seemed fine, the max(age(datfrozenxid)) was only about 330 million:postgres=# select datname,age(datfrozenxid) from pg_database;datname | age-----------+-----------mydb | 330688846postgres | 215500760template1 | 198965879template0 | 146483694mydb2 | 175585538(5 rows)We shutdown postgres, started it in single user mode, and VACUUMed each database. Then postgres started up fine, and the crisis is averted, for now.However my understanding must be wrong: I thought we could just look around for max(age(datfrozenxid)), make sure it's "low" (<2 billion), and be sure that this wouldn't happen. What am I misunderstanding?And then, I don't know which db has OID 0?postgres=# SELECT oid,datname from pg_database;oid | datname------------+-----------16422 | mydb12921 | postgres1 | template112916 | template01575433129 | mydb2(5 rows)Thank you for your help!