Skip site navigation (1) Skip section navigation (2)

Re: 7.1 pg_dump fails for user-defined types (release stopper?)

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org, pholben(at)greatbridge(dot)com
Subject: Re: 7.1 pg_dump fails for user-defined types (release stopper?)
Date: 2001-03-31 05:49:26
Message-ID: 3.0.5.32.20010331154926.026c3bd0@mail.rhyme.com.au (view raw or flat)
Thread:
Lists: pgsql-hackers
At 14:55 30/03/01 -0500, Tom Lane wrote:
>
>A more promising idea
>is to hack function creation so that the OID assigned to the function
>is lower than the OIDs assigned to any shell types created when the
>function is defined.

This seems hard; would it be better to have the CREATE TYPE use a new OID,
and fixup the refs?


>Or we could try to hack pg_dump to fix this,
>but that doesn't seem appetizing.

This *may* not be all that hard; there is a currently unused (always NULL)
parameter on the pg_dump ArchiveEntry calls intended for extra
dependencies. For UDTs, we could set the this to be the max OID that
references the type (or a list of OIDs, if we had to), then modify the
pg_restore sort code to check these values if not NULL. ie.

    (TOC2 > TOC1) 
        iff      (Max(TOC2.OID, TOC2.DEPS) > Max(TOC1.OID, TOC1.DEPS))
             OR  (    Max(TOC2.OID, TOC2.DEPS) = Max(TOC1.OID, TOC1.DEPS)
                  And TOC1.OID = Max(TOC2.DEPS)
                 )

    Where DEPS is a list of OIDs the TOC entry depends on.

(I *think* that's right...).

Since this will only be used when the args is non-null, this code would
only be activated in the current broken case.


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

In response to

Responses

pgsql-hackers by date

Next:From: Philip WarnerDate: 2001-03-31 05:58:04
Subject: Re: Re: 7.1 pg_dump fails for user-defined types (release stopper?)
Previous:From: Philip WarnerDate: 2001-03-31 05:06:33
Subject: Re: Re: Changing the default value of an inherited column

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group