One of the major must-fix items remaining on my to-do-for-7.0 list
is making pg_dump smarter about the order to dump stuff in, so as
to avoid problems like table constraints referring to not-yet-
defined functions.
We have talked about this before, and I thought some people had
expressed interest in fixing it, but I haven't seen any results.
Is anyone working on it?
If not, I'm willing to do the quick-and-dirty approach of sorting
the objects by OID. This could be extended later to allow a
dependency-based sort, but I don't have the time or interest to
attempt that now.
I'd be just as happy to yield the project to someone else though ;-)
regards, tom lane