Commit 75d2206
committed
Warning on SET of nonexisting setting with a prefix reserved by an extension
An extension can already de facto reserve a GUC prefix using
EmitWarningsOnPlaceholders(). But this was only checked against
settings that exist at the time the extension is loaded (or the
extension chooses to call this). No diagnostic is given when a SET
command later uses a nonexisting setting with a custom prefix.
With this change, EmitWarningsOnPlaceholders() saves the prefixes it
reserves in a list, and SET checks when it finds a "placeholder"
setting whether it belongs to a reserved prefix and issues a warning
in that case.
Add a regression test that checks the patch using the "plpgsql"
registered prefix.
Author: Florin Irion <florin.irion@enterprisedb.com>
Discussion: https://www.postgresql.org/message-id/flat/CA+HEvJDhWuuTpGTJT9Tgbdzm4QS4EzPAwDBScWK18H2Q=FVJFw@mail.gmail.com1 parent c3b34a0 commit 75d2206
3 files changed
+77
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| 238 | + | |
| 239 | + | |
238 | 240 | | |
239 | 241 | | |
240 | 242 | | |
| |||
8755 | 8757 | | |
8756 | 8758 | | |
8757 | 8759 | | |
| 8760 | + | |
8758 | 8761 | | |
8759 | 8762 | | |
8760 | 8763 | | |
| |||
8840 | 8843 | | |
8841 | 8844 | | |
8842 | 8845 | | |
| 8846 | + | |
| 8847 | + | |
8843 | 8848 | | |
8844 | 8849 | | |
8845 | 8850 | | |
| |||
9326 | 9331 | | |
9327 | 9332 | | |
9328 | 9333 | | |
| 9334 | + | |
9329 | 9335 | | |
9330 | 9336 | | |
9331 | 9337 | | |
| |||
9341 | 9347 | | |
9342 | 9348 | | |
9343 | 9349 | | |
| 9350 | + | |
| 9351 | + | |
| 9352 | + | |
| 9353 | + | |
9344 | 9354 | | |
9345 | 9355 | | |
| 9356 | + | |
| 9357 | + | |
| 9358 | + | |
| 9359 | + | |
| 9360 | + | |
| 9361 | + | |
| 9362 | + | |
| 9363 | + | |
| 9364 | + | |
| 9365 | + | |
| 9366 | + | |
| 9367 | + | |
| 9368 | + | |
| 9369 | + | |
| 9370 | + | |
| 9371 | + | |
| 9372 | + | |
| 9373 | + | |
| 9374 | + | |
| 9375 | + | |
| 9376 | + | |
| 9377 | + | |
| 9378 | + | |
| 9379 | + | |
| 9380 | + | |
| 9381 | + | |
| 9382 | + | |
| 9383 | + | |
| 9384 | + | |
| 9385 | + | |
| 9386 | + | |
| 9387 | + | |
| 9388 | + | |
| 9389 | + | |
| 9390 | + | |
| 9391 | + | |
| 9392 | + | |
9346 | 9393 | | |
9347 | 9394 | | |
9348 | 9395 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
813 | 813 | | |
814 | 814 | | |
815 | 815 | | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
0 commit comments