pg_dump --oids fails when default_with_oids = off

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема pg_dump --oids fails when default_with_oids = off
Дата
Msg-id 20050104175826.GA92283@winnie.fuhr.org
обсуждение исходный текст
Ответы Re: pg_dump --oids fails when default_with_oids = off  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
PostgreSQL 8.0.0rc3

When default_with_oids is set to "off", pg_dump --oids fails with
the following error:

% pg_dump --oids test
pg_dump: inserted invalid OID

This prevents the ability to dump OIDs for tables that were created
WITH OIDS.  The workaround is to set default_with_oids to "on".

The problem appears to be in setMaxOid() in src/bin/pg_dump/pg_dump.c:

    do_sql_command(g_conn,
                               "CREATE TEMPORARY TABLE pgdump_oid (dummy integer)");
    res = PQexec(g_conn, "INSERT INTO pgdump_oid VALUES (0)");
    check_sql_result(res, g_conn, "INSERT INTO pgdump_oid VALUES (0)",
                                     PGRES_COMMAND_OK);
    max_oid = PQoidValue(res);
    if (max_oid == 0)
    {
            write_msg(NULL, "inserted invalid OID\n");
            exit_nicely();
    }

Should the temporary table be created WITH OIDS, or is this a case
of "Doctor, it hurts when I do that"?

pg_restore might have a similar problem but I'll have to look at
that later this afternoon.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

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

Предыдущее
От: "T.J."
Дата:
Сообщение: Re: More SSL questions..
Следующее
От: Tom Lane
Дата:
Сообщение: Re: More SSL questions..