Commit 0461b66
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 9c34a05 commit 0461b66
1 file changed
+13
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12440 | 12440 | | |
12441 | 12441 | | |
12442 | 12442 | | |
12443 | | - | |
| 12443 | + | |
| 12444 | + | |
12444 | 12445 | | |
12445 | 12446 | | |
12446 | 12447 | | |
| |||
12674 | 12675 | | |
12675 | 12676 | | |
12676 | 12677 | | |
| 12678 | + | |
| 12679 | + | |
| 12680 | + | |
| 12681 | + | |
| 12682 | + | |
| 12683 | + | |
| 12684 | + | |
| 12685 | + | |
| 12686 | + | |
12677 | 12687 | | |
12678 | 12688 | | |
12679 | 12689 | | |
| |||
12701 | 12711 | | |
12702 | 12712 | | |
12703 | 12713 | | |
| 12714 | + | |
| 12715 | + | |
12704 | 12716 | | |
12705 | 12717 | | |
12706 | 12718 | | |
| |||
0 commit comments