pg_upgrade fails to detect unsupported arrays and ranges

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
Subject: pg_upgrade fails to detect unsupported arrays and ranges
Date: 2019-11-10 19:07:18
Message-ID: 31473.1573412838@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

While composing the release note entry for commits 8d48e6a72 et al
(handle recursive type dependencies while checking for unsupported
types in pg_upgrade), I realized that there's a huge hole in
pg_upgrade's test for such cases. It looks for domains containing
the unsupported type, and for composites containing it, but not
for arrays or ranges containing it. It's definitely possible to
create tables containing arrays of lines, or arrays of composites
containing line, etc etc. A range over line is harder for lack of
a btree opclass, but a range over sql_identifier is possible.

The attached patches fix this. 0001 refactors the code in question
so that we have only one copy not three-and-growing. The only
difference between the three copies was that one case didn't bother
to search indexes, but I judged that that wasn't an optimization we
need to preserve. (Note: this patch is shown with --ignore-space-change
to make it more reviewable, but I did re-pgindent the code.) Then
0002 actually adds the array and range cases.

Although this is a really straightforward patch and I've tested it
against appropriate old versions (9.1 and 9.2), I'm very hesitant
to shove it in so soon before a release wrap. Should I do that, or
let it wait till after the wrap?

regards, tom lane

Attachment Content-Type Size
0001-factor-out-common-code.patch text/x-diff 12.6 KB
0002-handle-arrays-and-ranges.patch text/x-diff 1.9 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2019-11-10 21:01:21 Re: pg_upgrade fails to detect unsupported arrays and ranges
Previous Message Magnus Hagander 2019-11-10 19:01:17 Re: ssl passphrase callback