forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitbac2ad3
committed
Change AdjustIntervalForTypmod to not discard higher-order field values on the
grounds that they don't fit into the specified interval qualifier (typmod).This behavior, while of long standing, is clearly wrong per spec --- forexample the value INTERVAL '999' SECOND means 999 seconds and should not bereduced to less than 60 seconds.In some cases there could be grounds to raise an error if higher-order fieldvalues are not given as zero; for example '1 year 1 month'::INTERVAL MONTHshould arguably be taken as an error rather than equivalent to 13 months.However our internal representation doesn't allow us to do that in a fashionthat would consistently reject all and only the cases that a strict readingof the spec would suggest. Also, seeing that for example INTERVAL '13' MONTHwill print out as '1 year 1 mon', we have to be careful not to create asituation where valid data will fail to dump and reload. The present patchtherefore takes the attitude of not throwing an error in any such case.We might want to revisit that in future but it would take more redesignthan seems prudent in late beta.Per a complaint from Sebastien Flaesch and subsequent discussion. Whileat other times we might have just postponed such an issue to the nextdevelopment cycle, 8.4 already has changed the parsing of interval literalsquite a bit in an effort to accept all spec-compliant cases correctly.This seems like a change that should be part of that rather than comingalong later.1 parentb3b89fd commitbac2ad3
File tree
3 files changed
+114
-83
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+114
-83
lines changedLines changed: 27 additions & 53 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
955 | 955 |
| |
956 | 956 |
| |
957 | 957 |
| |
958 |
| - | |
| 958 | + | |
959 | 959 |
| |
960 | 960 |
| |
961 | 961 |
| |
962 | 962 |
| |
963 | 963 |
| |
964 | 964 |
| |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
965 | 984 |
| |
966 | 985 |
| |
967 | 986 |
| |
| |||
974 | 993 |
| |
975 | 994 |
| |
976 | 995 |
| |
977 |
| - | |
978 | 996 |
| |
979 | 997 |
| |
980 | 998 |
| |
981 | 999 |
| |
982 | 1000 |
| |
983 | 1001 |
| |
984 |
| - | |
985 | 1002 |
| |
986 | 1003 |
| |
987 | 1004 |
| |
988 | 1005 |
| |
989 | 1006 |
| |
990 |
| - | |
991 | 1007 |
| |
992 | 1008 |
| |
993 | 1009 |
| |
994 | 1010 |
| |
995 |
| - | |
996 |
| - | |
997 |
| - | |
998 | 1011 |
| |
999 | 1012 |
| |
1000 | 1013 |
| |
| |||
1004 | 1017 |
| |
1005 | 1018 |
| |
1006 | 1019 |
| |
1007 |
| - | |
1008 |
| - | |
1009 |
| - | |
1010 |
| - | |
1011 |
| - | |
1012 | 1020 |
| |
1013 |
| - | |
1014 |
| - | |
1015 | 1021 |
| |
1016 | 1022 |
| |
1017 | 1023 |
| |
1018 |
| - | |
1019 | 1024 |
| |
1020 | 1025 |
| |
1021 | 1026 |
| |
1022 | 1027 |
| |
1023 | 1028 |
| |
1024 |
| - | |
1025 |
| - | |
1026 |
| - | |
1027 |
| - | |
1028 |
| - | |
1029 |
| - | |
1030 |
| - | |
1031 |
| - | |
1032 |
| - | |
1033 |
| - | |
1034 |
| - | |
1035 |
| - | |
| 1029 | + | |
1036 | 1030 |
| |
1037 | 1031 |
| |
1038 | 1032 |
| |
1039 | 1033 |
| |
1040 | 1034 |
| |
1041 |
| - | |
1042 |
| - | |
1043 | 1035 |
| |
1044 | 1036 |
| |
1045 | 1037 |
| |
| |||
1052 | 1044 |
| |
1053 | 1045 |
| |
1054 | 1046 |
| |
1055 |
| - | |
1056 |
| - | |
1057 | 1047 |
| |
1058 | 1048 |
| |
1059 | 1049 |
| |
| |||
1066 | 1056 |
| |
1067 | 1057 |
| |
1068 | 1058 |
| |
1069 |
| - | |
1070 |
| - | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
1071 | 1062 |
| |
1072 | 1063 |
| |
1073 | 1064 |
| |
1074 | 1065 |
| |
1075 |
| - | |
1076 |
| - | |
1077 |
| - | |
1078 | 1066 |
| |
1079 | 1067 |
| |
1080 | 1068 |
| |
| |||
1087 | 1075 |
| |
1088 | 1076 |
| |
1089 | 1077 |
| |
1090 |
| - | |
1091 |
| - | |
1092 |
| - | |
| 1078 | + | |
1093 | 1079 |
| |
1094 | 1080 |
| |
1095 | 1081 |
| |
1096 | 1082 |
| |
1097 | 1083 |
| |
1098 |
| - | |
1099 |
| - | |
1100 |
| - | |
1101 |
| - | |
1102 |
| - | |
1103 |
| - | |
1104 |
| - | |
1105 |
| - | |
1106 |
| - | |
1107 |
| - | |
1108 |
| - | |
| 1084 | + | |
1109 | 1085 |
| |
1110 | 1086 |
| |
1111 | 1087 |
| |
| |||
1148 | 1124 |
| |
1149 | 1125 |
| |
1150 | 1126 |
| |
1151 |
| - | |
1152 |
| - | |
1153 | 1127 |
| |
1154 | 1128 |
| |
1155 | 1129 |
| |
|
Lines changed: 78 additions & 30 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
358 | 358 |
| |
359 | 359 |
| |
360 | 360 |
| |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
361 | 365 |
| |
362 | 366 |
| |
363 | 367 |
| |
364 | 368 |
| |
365 | 369 |
| |
366 | 370 |
| |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
367 | 401 |
| |
368 | 402 |
| |
369 | 403 |
| |
| |||
472 | 506 |
| |
473 | 507 |
| |
474 | 508 |
| |
475 |
| - | |
476 |
| - | |
477 |
| - | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
478 | 512 |
| |
479 | 513 |
| |
480 | 514 |
| |
481 |
| - | |
482 |
| - | |
483 |
| - | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
484 | 518 |
| |
485 | 519 |
| |
486 | 520 |
| |
487 | 521 |
| |
488 | 522 |
| |
489 | 523 |
| |
490 | 524 |
| |
491 |
| - | |
492 |
| - | |
493 |
| - | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
494 | 528 |
| |
495 | 529 |
| |
496 | 530 |
| |
497 |
| - | |
498 |
| - | |
499 |
| - | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
500 | 534 |
| |
501 | 535 |
| |
502 | 536 |
| |
503 | 537 |
| |
504 | 538 |
| |
505 | 539 |
| |
506 | 540 |
| |
507 |
| - | |
508 |
| - | |
509 |
| - | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
510 | 544 |
| |
511 | 545 |
| |
512 | 546 |
| |
513 |
| - | |
514 |
| - | |
515 |
| - | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
516 | 550 |
| |
517 | 551 |
| |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
518 | 566 |
| |
519 | 567 |
| |
520 | 568 |
| |
| |||
585 | 633 |
| |
586 | 634 |
| |
587 | 635 |
| |
588 |
| - | |
589 |
| - | |
590 |
| - | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
591 | 639 |
| |
592 | 640 |
| |
593 | 641 |
| |
594 |
| - | |
595 |
| - | |
596 |
| - | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
597 | 645 |
| |
598 | 646 |
| |
599 | 647 |
| |
600 | 648 |
| |
601 | 649 |
| |
602 | 650 |
| |
603 | 651 |
| |
604 |
| - | |
605 |
| - | |
606 |
| - | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
607 | 655 |
| |
608 | 656 |
| |
609 | 657 |
| |
610 |
| - | |
611 |
| - | |
612 |
| - | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
613 | 661 |
| |
614 | 662 |
| |
615 | 663 |
| |
|
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
130 | 130 |
| |
131 | 131 |
| |
132 | 132 |
| |
| 133 | + | |
133 | 134 |
| |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
134 | 140 |
| |
135 | 141 |
| |
136 | 142 |
| |
| |||
159 | 165 |
| |
160 | 166 |
| |
161 | 167 |
| |
| 168 | + | |
| 169 | + | |
| 170 | + | |
162 | 171 |
| |
163 | 172 |
| |
164 | 173 |
| |
|
0 commit comments
Comments
(0)