Thread: pg_dump error
I'm rather new to database stuff. I've been using postgresql for a couple years, but that doesn't mean I understand what I'm doing. I have simply followed the "HOW-TOs". But now I think I'm about to learn a bit more about the inner workings... Last week my cron-triggered system-backup began reporting odd errors. They were block device and limited to just the one partition so I ran fsck. Oh, this is a Pentium-Pro based computer running Debian with a 2.4 kernel, SQL-Ledger 2.2.6 as my frontend, postgresql 7.2. So on with the story. fsck found a number of problems and I let it fix them all. No, I don't remember what the problems were. *grimace* The system backup is no longer yelling at me - but now my pg_dump is! It says: pg_dump: NOTICE: RelationBuildDesc: can't open pga_images: No such file or directory pg_dump: SQL command to dump the contents of table "pga_images" failed pg_dump: Error message from server: ERROR: cannot open pga_images: No such file or directory pg_dump: The command was: COPY "pga_images" TO stdout; Also, the Debian do.maintainence script is reporting: NOTICE: RelationBuildDesc: can't open pga_images: No such file or directory ERROR: _mdfd_getrelnfd: cannot open relation pga_images: No such file or directory So I tried: $ /usr/lib/postgresql/bin/vacuumdb -z -d mydata NOTICE: RelationBuildDesc: can't open pga_images: No such file or directory ERROR: _mdfd_getrelnfd: cannot open relation pga_images: No such file or directory vacuumdb: vacuum mydata failed Okay, now I'm stumped! Since I don't even know what "pga_images" is for I don't no how much trouble I'm in! Should I worry? Am I doomed? Can it be repaired? Will my computer explode and infect my neighborhood? (Have I used too many question-marks?) Nothing else seem to be broken, just the error messages about pga_images.. Philip, a bit worry about my database...
On 23/05/2004 20:32 Philip wrote: > [snip] > Okay, now I'm stumped! Since I don't even know what "pga_images" is for > I don't no how much trouble I'm in! Should I worry? Am I doomed? Can it > be repaired? Will my computer explode and infect my neighborhood? (Have > I used too many question-marks?) Nothing else seem to be broken, just the > error messages about pga_images.. I think pga_images is a table created by pgaccess. AFAIK, its not an SQL Ledger table (I use SQL Ledger too). I don't regard myself competent enough to advise you on fixing your DB but what I would do as a minimum would be to try to pg_dump each table (excluding any pga_* tables) so at least you've got all of you accounts data. HTH -- Paul Thomas +------------------------------+---------------------------------------------+ | Thomas Micro Systems Limited | Software Solutions for Business | | Computer Consultants | http://www.thomas-micro-systems-ltd.co.uk | +------------------------------+---------------------------------------------+
Philip <silvermaple@usermail.com> writes: > Okay, now I'm stumped! Since I don't even know what "pga_images" is for > I don't no how much trouble I'm in! Not a lot; that's not a system catalog but something that PgAccess creates. If you're not using PgAccess anymore, you can probably just drop the table and you're done. If you are, your best bet is to drop all the pga_foo tables so that PgAccess will recreate them all when you next start it. BTW, 7.2 is pretty ancient. You should update to at least 7.2.4. regards, tom lane
At some time fairly close to Sun, 23 May 2004 23:09:20 -0400, rumor has it that Tom wrote: > Philip <silvermaple@usermail.com> writes: > > Okay, now I'm stumped! Since I don't even know what "pga_images" is > > for I don't no how much trouble I'm in! > > Not a lot; that's not a system catalog but something that PgAccess > creates. If you're not using PgAccess anymore, you can probably just > drop the table and you're done. If you are, your best bet is to drop > all the pga_foo tables so that PgAccess will recreate them all when > you next start it. > > BTW, 7.2 is pretty ancient. You should update to at least 7.2.4. > > regards, tom lane Thanks Tom!! I really don't like to panic unless there is good reason for it... I'll upgrade to 7.2.4 and see if I can figure out how to drop some tables... Philip
At some time fairly close to Mon, 24 May 2004 14:03:28 +0100, rumor has it that Paul wrote: > On 24/05/2004 08:01 Philip wrote: > > I've got a _lot_ to learn about databases! *smiles* By looking at > > the size of the dumped file there is not much data missing, but I > > like your idea of doing each table. (I didn't know that was > > possible...) Do you have any tips on where I go to figure out how to > > show a list of the tables so I can dump them? There seems to be a > > lot of documentation - but so much of it is over my head my eyes are > > probably glazed over when I got to the good parts... *grin* > > Use psql: > > psql dbname > > then use the \d option. If I were trying to dump all tables > individually, I'd use psql's \o <filename> command to direct output to > a file before issuing the \d. Then I'd hack that file in a text editor > to create an appropriate shell script with commands of the form: > > pg_dump -t table database >table.txt Got it!! Thank you, thank you! I feel like I'm making progress. I've got to be careful, though or I might actually _learn_ this stuff... :) I think I had done some stuff from that shell 'cause it looks quite familiar - but I belive that was 2 year ago. I knew such a tool existed, just couldn't remember what it was. Again, thanks! Philip