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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jacob Champion <pchampion(at)pivotal(dot)io>
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:45:49
Message-ID: 1998.1533584749@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jacob Champion <pchampion(at)pivotal(dot)io> writes:
> ... since the
> root cause is that we're not defining a valid ordering, quicksort may
> or may not behave consistently for test purposes.

Ah, gotcha. But whether the behavior is sane or not, it'd be reproducible
for any specific input dataset on any specific platform (unless you've got
a quicksort that actually uses randomized pivots; but ours doesn't, and
I think that pg_dump does use src/port/qsort.c). So that partially
answers Andrew's question as to why we've not seen instability in the
buildfarm's results.

It also seems entirely possible that we simply don't have any cases in the
existing test data that provoke the indeterminate behavior --- to judge by
your concrete example, it might take specifically-chosen object names to
get into a situation where the comparator delivers inconsistent results.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2018-08-06 20:38:27 Re: pg_dump: sortDumpableObjectsByTypeName() doesn't always do that
Previous Message Jacob Champion 2018-08-06 19:34:47 Re: pg_dump: sortDumpableObjectsByTypeName() doesn't always do that