Thread: Bug in pg_dump

Bug in pg_dump

From
"Robert John Shepherd"
Date:
========================================================================
====
                        POSTGRESQL BUG REPORT TEMPLATE
========================================================================
====


Your name        :    Robert John Shepherd
Your email address    :       robert@reviewer.co.uk


System Configuration
---------------------
  Architecture (example: Intel Pentium)      :   Intel Pentium IV

  Operating System (example: Linux 2.0.26 ELF)     :   OpenBSD 3.1

  PostgreSQL version (example: PostgreSQL-7.2.3):   PostgreSQL-7.2.3

  Compiler used (example:  gcc 2.95.2)        :   2.95.3


Please enter a FULL description of your problem:
------------------------------------------------

pg_dump incorrectly dumps db schema when tsearch functions etc are
included

Functions and definitions relating to table creation are specified
correctly
before tables are defined, however those needed for index creation are
specified only after the indexes are created, causing errors during
restore.




Please describe a way to repeat the problem.   Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------

createdb testdb
psql testdb < tsearch.sql

create table t ( a text, b txtidx );
create index a_idx on t using GIST (b);

pg_dump testdb > test.sql

createdb testdb2
psql testdb2 < test.sql



If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

Dump all functions and types before indexes

Re: Bug in pg_dump

From
Rod Taylor
Date:
> If you know how this problem might be fixed, list the solution below:
> ---------------------------------------------------------------------
>
> Dump all functions and types before indexes

This causes errors in other ways.  The true solution is to have pg_dump
use a decent dependency tracking mechanism.  7.4 should hold the fix for
pg_dump, although 7.3 has the dependency tracking mechanism.

--
Rod Taylor <rbt@rbt.ca>

Re: Bug in pg_dump

From
Philip Warner
Date:
At 01:51 PM 15/11/2002 -0500, Rod Taylor wrote:
>7.4 should hold the fix for
>pg_dump, although 7.3 has the dependency tracking mechanism.

Which means that in theory we can back-patch them for 7.3.1.


----------------------------------------------------------------
Philip Warner                    |     __---_____
Albatross Consulting Pty. Ltd.   |----/       -  \
(A.B.N. 75 008 659 498)          |          /(@)   ______---_
Tel: (+61) 0500 83 82 81         |                 _________  \
Fax: (+61) 03 5330 3172          |                 ___________ |
Http://www.rhyme.com.au          |                /           \|
                                  |    --________--
PGP key available upon request,  |  /
and from pgp5.ai.mit.edu:11371   |/

Re: Bug in pg_dump

From
"Robert John Shepherd"
Date:
> >7.4 should hold the fix for
> >pg_dump, although 7.3 has the dependency tracking mechanism.
>
> Which means that in theory we can back-patch them for 7.3.1.

Not wanting to get too involved in discussions as to whether this should
be done or not, I would recommend you nice chaps save your strength for
other more deserving tasks. :)

I have worked around the problem successfully, it's not too difficult
and would only annoy people who change their schema regularly and do
restores from scratch just as regularly.

I'll put these in some docs I'm going to knock up for tsearch in the
next week or so, which should help other newbies like myself who want to
use full text indexing in postgresql.



Yours Unwhettedly,
Robert John Shepherd.

Technical Director
DVD REVIEWER
The UK's BIGGEST Online DVD Magazine http://www.dvd.reviewer.co.uk

For a copy of my Public PGP key, email: pgp@robertsworld.org.uk