Обсуждение: Bug #827: pg_dump in 7.3 can't dump 7.1 db

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

Bug #827: pg_dump in 7.3 can't dump 7.1 db

От
pgsql-bugs@postgresql.org
Дата:
Philip Warner (pjw@rhyme.com.au) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
pg_dump in 7.3 can't dump 7.1 db

Long Description
Whenevr dumping a 7.1 db using 7.3 pg_dump, I get:

pg_dump: last built-in OID is 18539
pg_dump: saving database definition
pg_dump: reading namespaces
pg_dump: reading user-defined types
pg_dump: reading user-defined functions
pg_dump: reading user-defined aggregate functions
pg_dump: reading user-defined operators
pg_dump: column number -1 is out of range 0..4
Segmentation fault


Sample Code


No file was uploaded with this report

Re: Bug #827: pg_dump in 7.3 can't dump 7.1 db

От
Philip Warner
Дата:
At 08:05 AM 1/12/2002 -0500, pgsql-bugs@postgresql.org wrote:
>pg_dump: reading user-defined operators
>pg_dump: column number -1 is out of range 0..4

Further investigation seems to indicate this is caused by the cast of
oprcode to oid at line 1687 of pg_dump.c ("oprcode::oid"). It results in
the output not being named 'oprcode'. I am a little surprised it's not a
problem in the 7.3 code branch as well - but maybe it is?



----------------------------------------------------------------
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 #827: pg_dump in 7.3 can't dump 7.1 db

От
Philip Warner
Дата:
At 12:16 AM 2/12/2002 +1100, Philip Warner wrote:
>this is caused by the cast of oprcode

Here's a (trivial) patch.


----------------------------------------------------------------
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 #827: pg_dump in 7.3 can't dump 7.1 db

От
Tom Lane
Дата:
Philip Warner <pjw@rhyme.com.au> writes:
> Further investigation seems to indicate this is caused by the cast of
> oprcode to oid at line 1687 of pg_dump.c ("oprcode::oid"). It results in
> the output not being named 'oprcode'. I am a little surprised it's not a
> problem in the 7.3 code branch as well - but maybe it is?

Ah --- probably back in 7.1, the backend's automatic output-column-name
selector was not bright enough to dig down inside typecasts.
Your patch (assign the column name explicitly) is a good one.

This brings up a more general issue, which is that we need to test
pg_dump against old backend versions as well as new ones.  I had had
a private "todo" item to run some tests of that sort for 7.3, but never
got 'round to it.

            regards, tom lane

Re: Bug #827: pg_dump in 7.3 can't dump 7.1 db

От
Tom Lane
Дата:
Philip Warner <pjw@rhyme.com.au> writes:
>> this is caused by the cast of oprcode

> Here's a (trivial) patch.

Applied in both REL7_3 and HEAD.  Thanks.

            regards, tom lane