Обсуждение: 8.1beta2 pg_dumpall inconsistencies

Поиск
Список
Период
Сортировка

8.1beta2 pg_dumpall inconsistencies

От
"Joshua D. Drake"
Дата:
After initializing a cluster with initdb -D data --no-locale as the user jd.
I created a table named foo in the template1 database.

create table foo(bar text, baz bigserial);

When executing pg_dumpall:

bin/pg_dumpall -U jd -p5500

Looks as it should. However:

[jd@jd pgsqldev]$ bin/pg_dumpall -U jd -D -o -p 5500

--
-- PostgreSQL database cluster dump
--

\connect postgres

--
-- Roles
--







--
-- Database creation
--

REVOKE ALL ON DATABASE template1 FROM PUBLIC;
REVOKE ALL ON DATABASE template1 FROM jd;
GRANT ALL ON DATABASE template1 TO jd;


--
-- Roles
--

ALTER ROLE jd WITH SUPERUSER INHERIT CREATEROLE CREATEDB LOGIN;


\connect postgres

pg_dump: INSERT (-d, -D) and OID (-o) options cannot be used together
pg_dump: (The INSERT command cannot set OIDs.)
pg_dumpall: pg_dump failed on database "postgres", exiting

Why am I getting a partial dump when the options are not compatible?

Further: bin/pg_dumpall -U jd -D -o -g -p 5500
--
-- PostgreSQL database cluster dump
--

\connect postgres

--
-- Roles
--







--
-- Roles
--

ALTER ROLE jd WITH SUPERUSER INHERIT CREATEROLE CREATEDB LOGIN;


--
-- PostgreSQL database cluster dump complete
--


Notice that I passed the -g (globals) flag but no globals have been
dumped and I don't get the error about -o and -D being used together.

Also: bin/pg_dumpall -U jd -g -p 5500
--
-- PostgreSQL database cluster dump
--

\connect postgres

--
-- Roles
--







--
-- Roles
--

ALTER ROLE jd WITH SUPERUSER INHERIT CREATEROLE CREATEDB LOGIN;


--
-- PostgreSQL database cluster dump complete
--


I have specified globals but I am not getting any:

template1=# select * from pg_roles;rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | 
rolcatupdate | rolcanlogin | rolconnlimit | rolpassword | rolvaliduntil 
| rolconfig | oid

---------+----------+------------+---------------+-------------+--------------+-------------+--------------+-------------+---------------+-----------+-----jd
    | t        | t          | t             | t           | 
 
t            | t           |           -1 | ********    |               
|           |  10
(1 row)



Sincerely,


Joshua D. Drake





-- 
Your PostgreSQL solutions company - Command Prompt, Inc. 1.800.492.2240
PostgreSQL Replication, Consulting, Custom Programming, 24x7 support
Managed Services, Shared and Dedicated Hosting
Co-Authors: plPHP, plPerlNG - http://www.commandprompt.com/



Re: 8.1beta2 pg_dumpall inconsistencies

От
Tom Lane
Дата:
"Joshua D. Drake" <jd@commandprompt.com> writes:
> [jd@jd pgsqldev]$ bin/pg_dumpall -U jd -D -o -p 5500
> ...
> pg_dump: INSERT (-d, -D) and OID (-o) options cannot be used together
> pg_dump: (The INSERT command cannot set OIDs.)
> pg_dumpall: pg_dump failed on database "postgres", exiting

> Why am I getting a partial dump when the options are not compatible?

Because -D and -o are pg_dump options, which pg_dumpall just passes down
without inspection.  I'm not sure that it makes sense to try to
replicate pg_dump's validity checking logic in pg_dumpall; I fear we'd
be more likely to cause problems by letting them get out of sync than
to solve problems by complaining a little sooner.
        regards, tom lane