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   |/

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly

Reply via email to