Re: pg_dump help

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Len Morgan" <len-morgan(at)crcom(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dump help
Date: 2000-08-08 03:54:52
Message-ID: 18537.965706892@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Len Morgan" <len-morgan(at)crcom(dot)net> writes:
> I am trying to copy a table from my local database to a client's. The
> problem is I keep getting a message from pg_dump:

> "can't find template1 database. You are really hosed."

Wow --- that does fall in the category of "shouldn't happen" errors.
(I assume you didn't do anything as silly as DROP DATABASE template1,
right?) The code that's coming out of is in src/bin/pg_dump/pg_dump.c:

res = PQexec(g_conn,
"SELECT oid from pg_database where datname = 'template1'");
if (res == NULL ||
PQresultStatus(res) != PGRES_TUPLES_OK)
{
fprintf(stderr, "pg_dump error in finding the template1 database. Explanation from backend: '%s'.\n", PQerrorMessage(g_conn));
exit_nicely(g_conn);
}
ntups = PQntuples(res);
if (ntups != 1)
{
fprintf(stderr, "pg_dump: couldn't find the template1 database. "
"You are really hosed.\nGiving up.\n");
exit_nicely(g_conn);
}

and offhand I don't see how that could go wrong short of truly-spectacular
failures. What do you see if you execute "SELECT oid,datname from
pg_database" by hand? What shows up in the postmaster log?

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Romanenko Mikhail 2000-08-08 03:59:49 Re: Trouble with float4 after upgrading from 6.5.3 to 7.0.2
Previous Message Philip Warner 2000-08-08 03:37:55 Re: [HACKERS] Re: Trouble with float4 afterupgrading from 6.5.3 to 7.0.2