pg_dump: SQL command failed

From: Oliver Kohll - Mailing Lists <oliver(dot)lists(at)gtwm(dot)co(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: pg_dump: SQL command failed
Date: 2010-02-12 12:29:49
Message-ID: 546577B3-32B8-4335-928B-98D53216E4E1@gtwm.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I've just come across this in an output from a cron backup script:

/etc/cron.hourly/gtwm_backup_databases.sh:

pg_dump: SQL command failed
pg_dump: Error message from server: ERROR: could not open relation with OID 572838
pg_dump: The command was: SELECT pg_catalog.pg_get_viewdef('572838'::pg_catalog.oid) AS viewdef

The complete script is

#!/bin/bash
nice /usr/bin/pg_dump -U postgres -f /var/local/backup/agilebaseschema_`/bin/date +%H`.sql agilebaseschema
nice /usr/bin/pg_dump -U postgres --exclude-table=dbint_log_* -f /var/local/backup/agilebasedata_`/bin/date +%H`.sql agilebasedata

Running the script again manually, it works with no errors and I haven't noticed the error before. Unfortunately I recently deleted my archive of cron results so I can't do an exhaustive check and I can't see anything in the postgres log either but it's the first time I've noticed it since I can remember.

A web search shows other people have come across this before now and again though I can't see any resolutions. I'm running postgres v8.4.1.

Running that SELECT statement manually on both databases returns

agilebasedata=# SELECT pg_catalog.pg_get_viewdef('572838'::pg_catalog.oid) AS viewdef;
viewdef
------------
Not a view
(1 row)

Views are regularly altered, dropped and created in the agilebasedata database, 15 times today to date, which have all succeeded without error.

Any help on what could cause that error?

Regards
Oliver Kohll
oliver(at)agilebase(dot)co(dot)uk / 0845 456 1810 / 07814 828608
www.agilebase.co.uk - software
www.gtwm.co.uk - company

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Allan Kamau 2010-02-12 12:32:03 Weeding out unused user created database objects, could I use pg_catalog?
Previous Message A. Kretschmer 2010-02-12 11:46:35 Re: Function that creates a custom (temporary) table AND returns a pointer to it = impossible in pg?