Commit 5886c7d
committed
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.se1 parent 50d9476 commit 5886c7d
1 file changed
+13
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12771 | 12771 | | |
12772 | 12772 | | |
12773 | 12773 | | |
12774 | | - | |
| 12774 | + | |
| 12775 | + | |
12775 | 12776 | | |
12776 | 12777 | | |
12777 | 12778 | | |
| |||
13005 | 13006 | | |
13006 | 13007 | | |
13007 | 13008 | | |
| 13009 | + | |
| 13010 | + | |
| 13011 | + | |
| 13012 | + | |
| 13013 | + | |
| 13014 | + | |
| 13015 | + | |
| 13016 | + | |
| 13017 | + | |
13008 | 13018 | | |
13009 | 13019 | | |
13010 | 13020 | | |
| |||
13032 | 13042 | | |
13033 | 13043 | | |
13034 | 13044 | | |
| 13045 | + | |
| 13046 | + | |
13035 | 13047 | | |
13036 | 13048 | | |
13037 | 13049 | | |
| |||
0 commit comments