Backup when the database is missing all of the pg_* tables
Backup when the database is missing all of the pg_* tables
От:
Daniel Browning <db@kavod.com>
Дата:
How can I backup a database (for restoration) when it is missing all of the pg_* tables? I've been bitten by the "SELinux silently ruins initdb" bug as reported by Tom Lane: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=149237 and another user: http://www.mail-archive.com/pgsql-bugs@postgresql.org/msg11191.html Unfortunately, I didn't notice the problem until after the database had new data added to it. I need to backup the database and recreate it with initdb, but pg_dump doesn't work: relation "pg_user" does not exist I tried "--data-only --no-owner --no-privileges" to no avail. I can still do '\d
Re: Backup when the database is missing all of the pg_* tables
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Daniel Browning writes: > I've been bitten by the "SELinux silently ruins initdb" bug as reported by Tom > Lane: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=149237 and another > user: http://www.mail-archive.com/pgsql-bugs@postgresql.org/msg11191.html While I have not tried to get out of that situation myself, I think it should be doable. The basic point is that the SELinux bug^H^H^Hsecurity policy prevented certain parts of the initdb script from taking effect; in particular those that created system views such as pg_user. So what you gotta do is execute those CREATE VIEW commands by hand as superuser, and then pg_dump should work. I think. The parts of initdb that were foiled are the parts that look like postgres <