Re: [HACKERS] Bug when dumping "empty" operator classes - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Bug when dumping "empty" operator classes
Date
Msg-id 30099.1495811285@sss.pgh.pa.us
Whole thread Raw
In response to [HACKERS] Bug when dumping "empty" operator classes  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: [HACKERS] Bug when dumping "empty" operator classes  (Daniel Gustafsson <daniel@yesql.se>)
List pgsql-hackers
Daniel Gustafsson <daniel@yesql.se> writes:
> While hacking on pg_upgrade in downstream Greenplum I ran into an error which
> seems like an old, and obscure, bug in pg_dump (unrelated to pg_upgrade).
> pg_dump generates incorrect SQL for an operator class which has no operators or
> procedures, and which has the same column and storage types.

Good catch.

> The attached patch adds a belts-and-suspenders check in dumpOpclass() which
> appends the STORAGE clause in case nothing had been added.

Seems reasonable (the comment could use some wordsmithing maybe) ...

> ... The DROP in
> alter_generic is also removed to exercise the code path, being able to
> pg_upgrade what is executed in regression seem like a good idea.

... but that's a nonstarter.  We can't have the regression tests leaving
global objects (users) lying around.

I'll commit and back-patch this without a test case.  Possibly Frost will
be excited enough about it to add something to the pg_dump TAP tests,
but those tests are too opaque for me to want to do so.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Petr Jelinek
Date:
Subject: Re: [HACKERS] logical replication - still unstable after all thesemonths
Next
From: Daniel Gustafsson
Date:
Subject: Re: [HACKERS] Bug when dumping "empty" operator classes