Forum OpenACS Q&A: Re: Problem with Postgres v7.2.3 restore of .dmp

Collapse
Posted by Richard Hamilton on
Oh, and here is the result on server re-start :

Request Error
Server startup failed: Error during bootstrapping
Database operation "0or1row" failed (exception NSDB, "Query was not a statement returning rows.")
    while executing
"ns_pg_bind 0or1row nsdb0 {

        select 1 as admin_exists_p
        from dual
        where exists (select 1
                      from all_o..."
    ("uplevel" body line 1)
    invoked from within
"uplevel $ulevel [list ns_pg_bind $type $db $sql"
    invoked from within
"db_exec 0or1row $db $full_name $sql"
    invoked from within
"set selection [db_exec 0or1row $db $full_name $sql]"
    ("uplevel" body line 2)
    invoked from within
"uplevel 1 $code_block "
    invoked from within
"db_with_handle db {
    set selection [db_exec 0or1row $db $full_name $sql]
    }"
    (procedure "db_string" line 7)
    invoked from within
"db_string admin_exists_p {} -default 0"
    (procedure "ad_acs_administrator_exists_p" line 2)
    invoked from within
"ad_acs_administrator_exists_p"
    (procedure "ad_verify_install" line 8)
    invoked from within
"ad_verify_install"

Collapse
Posted by Richard Hamilton on
A quick scan of the PostgreSQL online docs revealed a small detail that I didn't know which is that pg_dump creates .dmp files that are relative to template0.

So when I retried the restore I typed the following :

createdb -T template0 dbname

and then ran the restore as before.

All now hunky-dorie.

I think my problem stemmed from the fact that I have password authentication set up in postgres. I think that some of the DML statements in the dump were trying to do something to pre-existing functions in template1 owned by another user.

I post this in case it helps someone sometime!

R.