Fix ALTER OPERATOR to update dependencies properly.
Tom Lane <tgl@sss.pgh.pa.us>
Fix ALTER OPERATOR to update dependencies properly. Fix an oversight in commit 321eed5f0f7563a0: replacing an operator's selectivity functions needs to result in a corresponding update in pg_depend. We have a function that can handle that, but it was not called by AlterOperator(). To fix this without enlarging pg_operator.h's #include list beyond what clients can safely include, split off the function definitions into a new file pg_operator_fn.h, similarly to what we've done for some other catalog header files. It's not entirely clear whether any client-side code needs to include pg_operator.h, but it seems prudent to assume that there is some such code somewhere.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/catalog/pg_operator.c | modified | +21 −14 |
| src/backend/commands/operatorcmds.c | modified | +3 −2 |
| src/include/catalog/pg_operator_fn.h | added | +34 −0 |
| src/include/catalog/pg_operator.h | modified | +0 −17 |
| src/test/regress/expected/alter_operator.out | modified | +67 −6 |
| src/test/regress/sql/alter_operator.sql | modified | +38 −3 |