Re: pg_dump help

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg_dump help
Дата
Msg-id 18537.965706892@sss.pgh.pa.us
обсуждение исходный текст
Ответ на pg_dump help  ("Len Morgan" <len-morgan@crcom.net>)
Список pgsql-general
"Len Morgan" <len-morgan@crcom.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

В списке pgsql-general по дате отправления:

Предыдущее
От: Philip Warner
Дата:
Сообщение: Re: [HACKERS] Re: Trouble with float4 afterupgrading from 6.5.3 to 7.0.2
Следующее
От: "Romanenko Mikhail"
Дата:
Сообщение: Re: Trouble with float4 after upgrading from 6.5.3 to 7.0.2