forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit546f7c2
committed
Don't fail for bad GUCs in CREATE FUNCTION with check_function_bodies off.
The previous coding attempted to activate all the GUC settings specifiedin SET clauses, so that the function validator could operate in the GUCenvironment expected by the function body. However, this is problematicwhen restoring a dump, since the SET clauses might refer to databaseobjects that don't exist yet. We already have the parametercheck_function_bodies that's meant to prevent forward references infunction definitions from breaking dumps, so let's change CREATE FUNCTIONto not install the SET values if check_function_bodies is off.Authors of function validators were already advised not to make any"context sensitive" checks when check_function_bodies is off, if indeedthey're checking anything at all in that mode. But extend thedocumentation to point out the GUC issue in particular.(Note that we still check the SET clauses to some extent; the behaviorwith !check_function_bodies is now approximately equivalent to what ALTERDATABASE/ROLE have been doing for awhile with context-dependent GUCs.)This problem can be demonstrated in all active branches, so back-patchall the way.1 parent0d3f440 commit546f7c2
File tree
4 files changed
+63
-12
lines changed- doc/src/sgml
- src
- backend/catalog
- test/regress
- expected
- sql
4 files changed
+63
-12
lines changedLines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
200 | 200 |
| |
201 | 201 |
| |
202 | 202 |
| |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
203 | 210 |
| |
204 | 211 |
| |
205 | 212 |
| |
|
Lines changed: 22 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
668 | 668 |
| |
669 | 669 |
| |
670 | 670 |
| |
671 |
| - | |
672 |
| - | |
| 671 | + | |
| 672 | + | |
673 | 673 |
| |
674 | 674 |
| |
675 | 675 |
| |
676 | 676 |
| |
677 |
| - | |
678 |
| - | |
679 |
| - | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
680 | 688 |
| |
681 |
| - | |
682 |
| - | |
683 |
| - | |
684 |
| - | |
685 |
| - | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
686 | 698 |
| |
687 |
| - | |
688 |
| - | |
689 | 699 |
| |
690 | 700 |
| |
691 | 701 |
| |
|
Lines changed: 16 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
718 | 718 |
| |
719 | 719 |
| |
720 | 720 |
| |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + |
Lines changed: 18 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
257 | 257 |
| |
258 | 258 |
| |
259 | 259 |
| |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + |
0 commit comments
Comments
(0)