forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit21f428e
committed
Don't call data type input functions in GUC check hooks
Instead of calling pg_lsn_in() in check_recovery_target_lsn andtimestamptz_in() in check_recovery_target_time, reorganize therespective code so that we don't raise any errors in the check hooks.The previous code tried to use PG_TRY/PG_CATCH to handle errors in away that is not safe, so now the code contains no ereport() calls andcan operate safely within the GUC error handling system.Moreover, since the interpretation of the recovery_target_time stringmay depend on the time zone, we cannot do the final processing of thatstring until all the GUC processing is done. Instead,check_recovery_target_time() now does some parsing for syntaxchecking, but the actual conversion to a timestamptz value is donelater in the recovery code that uses it.Reported-by: Andres Freund <andres@anarazel.de>Reviewed-by: Michael Paquier <michael@paquier.xyz>Discussion:https://www.postgresql.org/message-id/flat/20190611061115.njjwkagvxp4qujhp%40alap3.anarazel.de1 parent666cbae commit21f428e
5 files changed
+85
-74
lines changedLines changed: 14 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
272 | 272 |
| |
273 | 273 |
| |
274 | 274 |
| |
275 |
| - | |
| 275 | + | |
| 276 | + | |
276 | 277 |
| |
277 | 278 |
| |
278 | 279 |
| |
| |||
5409 | 5410 |
| |
5410 | 5411 |
| |
5411 | 5412 |
| |
| 5413 | + | |
| 5414 | + | |
| 5415 | + | |
| 5416 | + | |
| 5417 | + | |
| 5418 | + | |
| 5419 | + | |
| 5420 | + | |
| 5421 | + | |
| 5422 | + | |
| 5423 | + | |
| 5424 | + | |
5412 | 5425 |
| |
5413 | 5426 |
| |
5414 | 5427 |
| |
|
Lines changed: 27 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
28 |
| - | |
29 |
| - | |
| 28 | + | |
| 29 | + | |
30 | 30 |
| |
31 |
| - | |
32 | 31 |
| |
33 | 32 |
| |
34 | 33 |
| |
| |||
38 | 37 |
| |
39 | 38 |
| |
40 | 39 |
| |
41 |
| - | |
42 |
| - | |
43 |
| - | |
44 |
| - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
45 | 44 |
| |
46 | 45 |
| |
47 |
| - | |
48 |
| - | |
49 |
| - | |
50 |
| - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
51 | 50 |
| |
52 | 51 |
| |
53 | 52 |
| |
| |||
57 | 56 |
| |
58 | 57 |
| |
59 | 58 |
| |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
60 | 76 |
| |
61 | 77 |
| |
62 | 78 |
| |
|
Lines changed: 41 additions & 61 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
579 | 579 |
| |
580 | 580 |
| |
581 | 581 |
| |
582 |
| - | |
583 | 582 |
| |
584 | 583 |
| |
585 | 584 |
| |
| |||
11572 | 11571 |
| |
11573 | 11572 |
| |
11574 | 11573 |
| |
| 11574 | + | |
| 11575 | + | |
| 11576 | + | |
| 11577 | + | |
| 11578 | + | |
| 11579 | + | |
| 11580 | + | |
11575 | 11581 |
| |
11576 | 11582 |
| |
11577 | 11583 |
| |
11578 | 11584 |
| |
11579 | 11585 |
| |
11580 |
| - | |
11581 |
| - | |
11582 |
| - | |
11583 |
| - | |
11584 | 11586 |
| |
11585 |
| - | |
11586 |
| - | |
11587 |
| - | |
11588 |
| - | |
| 11587 | + | |
11589 | 11588 |
| |
11590 | 11589 |
| |
11591 | 11590 |
| |
11592 | 11591 |
| |
11593 | 11592 |
| |
11594 | 11593 |
| |
11595 | 11594 |
| |
11596 |
| - | |
11597 |
| - | |
11598 |
| - | |
11599 |
| - | |
11600 |
| - | |
11601 |
| - | |
11602 |
| - | |
11603 |
| - | |
| 11595 | + | |
| 11596 | + | |
| 11597 | + | |
11604 | 11598 |
| |
11605 |
| - | |
11606 |
| - | |
11607 |
| - | |
11608 |
| - | |
11609 |
| - | |
11610 |
| - | |
11611 |
| - | |
11612 |
| - | |
11613 |
| - | |
11614 |
| - | |
11615 |
| - | |
| 11599 | + | |
| 11600 | + | |
| 11601 | + | |
| 11602 | + | |
| 11603 | + | |
| 11604 | + | |
| 11605 | + | |
| 11606 | + | |
| 11607 | + | |
| 11608 | + | |
| 11609 | + | |
| 11610 | + | |
| 11611 | + | |
| 11612 | + | |
| 11613 | + | |
| 11614 | + | |
| 11615 | + | |
| 11616 | + | |
| 11617 | + | |
| 11618 | + | |
| 11619 | + | |
| 11620 | + | |
| 11621 | + | |
| 11622 | + | |
| 11623 | + | |
| 11624 | + | |
| 11625 | + | |
11616 | 11626 |
| |
11617 |
| - | |
11618 |
| - | |
11619 |
| - | |
11620 |
| - | |
11621 |
| - | |
11622 | 11627 |
| |
11623 | 11628 |
| |
11624 | 11629 |
| |
| |||
11631 | 11636 |
| |
11632 | 11637 |
| |
11633 | 11638 |
| |
11634 |
| - | |
11635 | 11639 |
| |
11636 |
| - | |
11637 |
| - | |
11638 | 11640 |
| |
11639 | 11641 |
| |
11640 | 11642 |
| |
| |||
11675 | 11677 |
| |
11676 | 11678 |
| |
11677 | 11679 |
| |
11678 |
| - | |
11679 |
| - | |
11680 |
| - | |
11681 |
| - | |
11682 |
| - | |
11683 |
| - | |
11684 |
| - | |
11685 |
| - | |
11686 |
| - | |
11687 |
| - | |
11688 |
| - | |
11689 |
| - | |
11690 |
| - | |
11691 |
| - | |
11692 |
| - | |
11693 |
| - | |
11694 |
| - | |
11695 |
| - | |
11696 |
| - | |
11697 |
| - | |
| 11680 | + | |
11698 | 11681 |
| |
11699 |
| - | |
11700 |
| - | |
11701 |
| - | |
| 11682 | + | |
| 11683 | + | |
11702 | 11684 |
| |
11703 |
| - | |
11704 |
| - | |
11705 | 11685 |
| |
11706 | 11686 |
| |
11707 | 11687 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
132 | 132 |
| |
133 | 133 |
| |
134 | 134 |
| |
135 |
| - | |
| 135 | + | |
136 | 136 |
| |
137 | 137 |
| |
138 | 138 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
24 | 24 |
| |
25 | 25 |
| |
26 | 26 |
| |
| 27 | + | |
| 28 | + | |
27 | 29 |
|
0 commit comments
Comments
(0)