[PATCH] pg_dump: Sort overloaded functions in deterministic order

From: Joel Jacobson <joel(at)trustly(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: [PATCH] pg_dump: Sort overloaded functions in deterministic order
Date: 2012-07-04 15:17:26
Message-ID: CAASwCXcKgiYdCj-YO2+VkRm55mkn=r4aeYWn1AWp2GPSkGtppw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I have received positive feedback on the pg_dump --split option I suggested,
but it depends on pg_dump dumping objects in a deterministic order.

I'm committed to fixing this. The first problem I've spotted is overloaded
functions.

This patch adds a new element to DumpableObject: char *proargs
This is set to the output from pg_get_function_identity_arguments(oid)
for all functions, and set to NULL for all other objects.

sortDumpableObjectsByTypeName calls DOTypeNameCompare, which in addition
to sorting objects by type, namespace and name, now also sorts by
the function identity arguments.

This makes overloaded functions being dumped in the same order,
regardless of which order they were created.

Are there any other object types where the order isn't deterministic?

Attachment Content-Type Size
pg_dump_deterministic_order.patch application/octet-stream 12.7 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2012-07-04 15:17:52 Re: pgfoundry references in docs
Previous Message Dimitri Fontaine 2012-07-04 15:00:19 Re: Event Triggers reduced, v1