[COMMITTERS] pgsql: Fix pg_dump to not emit invalid SQL for an empty operatorclass. - Mailing list pgsql-committers

From Tom Lane
Subject [COMMITTERS] pgsql: Fix pg_dump to not emit invalid SQL for an empty operatorclass.
Date
Msg-id E1dEISS-0005gF-5g@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix pg_dump to not emit invalid SQL for an empty operator class.

If an operator class has no operators or functions, and doesn't need
a STORAGE clause, we emitted "CREATE OPERATOR CLASS ... AS ;" which
is syntactically invalid.  Fix by forcing a STORAGE clause to be
emitted anyway in this case.

(At some point we might consider changing the grammar to allow CREATE
OPERATOR CLASS without an opclass_item_list.  But probably we'd want to
omit the AS in that case, so that wouldn't fix this pg_dump issue anyway.)

It's been like this all along, so back-patch to all supported branches.

Daniel Gustafsson, tweaked by me to avoid a dangling-pointer bug

Discussion: https://postgr.es/m/D9E5FC64-7A37-4F3D-B946-7E4FB468F88A@yesql.se

Branch
------
REL9_3_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a561254e4c620ca9d62044520bd05cfe687f786c

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)


pgsql-committers by date:

Previous
From: Magnus Hagander
Date:
Subject: [COMMITTERS] pgsql: Remove docs mention of PGREALM variable
Next
From: Tom Lane
Date:
Subject: [COMMITTERS] pgsql: Move autogenerated array types out of the way during ALTER ...R