pg_dump creates bad dump / pgadmin crash issue

Started by Daniel Whitterover 20 years ago2 messagesgeneral
Jump to latest
#1Daniel Whitter
dwhitter@intern.solution-x.com

Hello,

I'm new to postgresql and during testing for a script I've found some
curious things.

If I do the following things a bad dump will be created that can't be
restored (using pgadmin3, pg_dump and pg_restore or psql).
There's also a issue that pgadmin crash.

In pgadmin3 do
1) Create a new db ('test_dump')
2) Create a new schema ('test_dump')

3) From schema 'pg_catalog' copy the lines from
CREATE OPERATOR <(... for <(abstime,abstime), <=(abstime,abstime),
=(abstime,abstime), >(abstime,abstime), >=(abstime,abstime)
and paste it in the query window. Write the schema name 'test_dump.'

before the operator sign and execute the query.
I've done this once for each operator.

4) Then copy the lines for operator class 'abstime_ops(btree)' from
schema 'pg_catalog' and paste it in the query window.
Write the schema name 'test_dump.' before the class and remove the
'default'. Then execute the query.

If you click on the created operator class in schema 'test_dump'
you'll get a error message box or on windows pgAdmin will crash.

If you create a dump (pg_dump) of this schema and try to restore
it you'll get a error from pg_restore or psql.

daniel@artus ~ $ psql -d test_dump -f testdump.sql -U postgres
SET
SET
SET
CREATE SCHEMA
SET
psql:testdump.sql:29: ERROR: syntax error at or near ">" at character
123
psql:testdump.sql:29: LINE 5: COMMUTATOR = pg_catalog.>,
psql:testdump.sql:29: ^
psql:testdump.sql:43: ERROR: syntax error at or near ">=" at character
124
psql:testdump.sql:43: LINE 5: COMMUTATOR = pg_catalog.>=,
psql:testdump.sql:43: ^
psql:testdump.sql:62: ERROR: syntax error at or near "=" at character
123
psql:testdump.sql:62: LINE 5: COMMUTATOR = pg_catalog.=,
psql:testdump.sql:62: ^
psql:testdump.sql:76: ERROR: syntax error at or near "<" at character
123
psql:testdump.sql:76: LINE 5: COMMUTATOR = pg_catalog.<,
psql:testdump.sql:76: ^
psql:testdump.sql:90: ERROR: syntax error at or near "<=" at character
124
psql:testdump.sql:90: LINE 5: COMMUTATOR = pg_catalog.<=,
psql:testdump.sql:90: ^
CREATE OPERATOR CLASS
dw@artus ~ $

daniel@aruts> postmaster --version
postmaster (PostgreSQL) 8.0.4

pgadmin3 version 1.4.1

greetings,
Daniel Whitter

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Daniel Whitter (#1)
Re: pg_dump creates bad dump / pgadmin crash issue

"Daniel Whitter" <dwhitter@intern.solution-x.com> writes:

If I do the following things a bad dump will be created that can't be
restored (using pgadmin3, pg_dump and pg_restore or psql).
There's also a issue that pgadmin crash.

You should report the pgadmin crash to the pgadmin people (who may or
may not follow this list closely). The dump problem is a pg_dump bug
which I've just fixed. Apparently you're the first to ever try dumping
an operator definition that contains a cross-schema operator reference :-(.
There should be an OPERATOR() decoration around those names, but pg_dump
didn't know that ...

regards, tom lane