Re: pg_dump: sortDumpableObjectsByTypeName() doesn't always do that

From: Jacob Champion <pchampion(at)pivotal(dot)io>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_dump: sortDumpableObjectsByTypeName() doesn't always do that
Date: 2018-08-06 19:34:47
Message-ID: CABAq_6F3bn-hg0q2V9GEPUXQwNZu++sWpVsYeEkc7OLBg-S7qw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 6, 2018 at 12:23 PM Jacob Champion <pchampion(at)pivotal(dot)io> wrote:
> since the
> root cause is that we're not defining a valid ordering, quicksort may
> or may not behave consistently for test purposes.

To expand on this, consider three objects, of the same type, compared
with the current comparator function:

namespace_a.object_3 < namespace_b.object_1 (because a < b)
NULL.object_2 < namespace_a.object_3 (because 2 < 3)
namespace_b.object_1 < NULL.object_2 (because 1 < 2)

This is rock-paper-scissors instead of a partial ordering.

--Jacob

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-08-06 19:45:49 Re: pg_dump: sortDumpableObjectsByTypeName() doesn't always do that
Previous Message Stephen Frost 2018-08-06 19:32:39 Re: Standby trying "restore_command" before local WAL