forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitbffe1bd
committed
Implement jsonpath .datetime() method
This commit implements jsonpath .datetime() method as it's specified inSQL/JSON standard. There are no-argument and single-argument versions ofthis method. No-argument version selects first of ISO datetime formatsmatching input string. Single-argument version accepts template string asits argument.Additionally to .datetime() method itself this commit also implementscomparison ability of resulting date and time values. There is some difficultybecause exising jsonb_path_*() functions are immutable, while comparison oftimezoned and non-timezoned types involves current timezone. At first, currenttimezone could be changes in session. Moreover, timezones themselves are notimmutable and could be updated. This is why we let existing immutable functionsthrow errors on such non-immutable comparison. In the same time this commitprovides jsonb_path_*_tz() functions which are stable and support operationsinvolving timezones. As new functions are added to the system catalog,catversion is bumped.Support of .datetime() method was the only blocker prevents T832 from beingmarked as supported. sql_features.txt is updated correspondingly.Extracted from original patch by Nikita Glukhov, Teodor Sigaev, Oleg Bartunov.Heavily revised by me. Comments were adjusted by Liudmila Mantrova.Discussion:https://postgr.es/m/fcc6fc6a-b497-f39a-923d-aa34d0c588e8%402ndQuadrant.comDiscussion:https://postgr.es/m/CAPpHfdsZgYEra_PeCLGNoXOWYx6iU-S3wF8aX0ObQUcZU%2B4XTw%40mail.gmail.comAuthor: Alexander Korotkov, Nikita Glukhov, Teodor Sigaev, Oleg Bartunov, Liudmila MantrovaReviewed-by: Anastasia Lubennikova, Peter Eisentraut1 parent6dda292 commitbffe1bd
File tree
15 files changed
+1355
-45
lines changed- doc/src/sgml
- src
- backend
- catalog
- utils
- adt
- include
- catalog
- utils
- test/regress
- expected
- sql
15 files changed
+1355
-45
lines changedLines changed: 101 additions & 16 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
11910 | 11910 |
| |
11911 | 11911 |
| |
11912 | 11912 |
| |
11913 |
| - | |
11914 |
| - | |
11915 |
| - | |
11916 |
| - | |
11917 |
| - | |
11918 |
| - | |
11919 |
| - | |
11920 |
| - | |
11921 |
| - | |
11922 |
| - | |
11923 | 11913 |
| |
11924 | 11914 |
| |
11925 | 11915 |
| |
| |||
12190 | 12180 |
| |
12191 | 12181 |
| |
12192 | 12182 |
| |
| 12183 | + | |
| 12184 | + | |
| 12185 | + | |
| 12186 | + | |
| 12187 | + | |
| 12188 | + | |
| 12189 | + | |
| 12190 | + | |
| 12191 | + | |
| 12192 | + | |
| 12193 | + | |
| 12194 | + | |
| 12195 | + | |
| 12196 | + | |
12193 | 12197 |
| |
12194 | 12198 |
| |
12195 | 12199 |
| |
| |||
12207 | 12211 |
| |
12208 | 12212 |
| |
12209 | 12213 |
| |
| 12214 | + | |
| 12215 | + | |
| 12216 | + | |
| 12217 | + | |
| 12218 | + | |
| 12219 | + | |
| 12220 | + | |
| 12221 | + | |
| 12222 | + | |
| 12223 | + | |
| 12224 | + | |
| 12225 | + | |
| 12226 | + | |
| 12227 | + | |
| 12228 | + | |
| 12229 | + | |
| 12230 | + | |
| 12231 | + | |
| 12232 | + | |
| 12233 | + | |
| 12234 | + | |
| 12235 | + | |
| 12236 | + | |
| 12237 | + | |
| 12238 | + | |
| 12239 | + | |
| 12240 | + | |
| 12241 | + | |
| 12242 | + | |
| 12243 | + | |
| 12244 | + | |
12210 | 12245 |
| |
12211 | 12246 |
| |
12212 | 12247 |
| |
| |||
12350 | 12385 |
| |
12351 | 12386 |
| |
12352 | 12387 |
| |
| 12388 | + | |
| 12389 | + | |
| 12390 | + | |
| 12391 | + | |
| 12392 | + | |
| 12393 | + | |
| 12394 | + | |
| 12395 | + | |
| 12396 | + | |
12353 | 12397 |
| |
12354 | 12398 |
| |
12355 | 12399 |
| |
| |||
12582 | 12626 |
| |
12583 | 12627 |
| |
12584 | 12628 |
| |
12585 |
| - | |
| 12629 | + | |
12586 | 12630 |
| |
12587 | 12631 |
| |
12588 | 12632 |
| |
| |||
12851 | 12895 |
| |
12852 | 12896 |
| |
12853 | 12897 |
| |
| 12898 | + | |
| 12899 | + | |
| 12900 | + | |
12854 | 12901 |
| |
12855 | 12902 |
| |
12856 | 12903 |
| |
| 12904 | + | |
| 12905 | + | |
| 12906 | + | |
12857 | 12907 |
| |
12858 | 12908 |
| |
12859 | 12909 |
| |
| 12910 | + | |
| 12911 | + | |
| 12912 | + | |
12860 | 12913 |
| |
12861 | 12914 |
| |
12862 | 12915 |
| |
| 12916 | + | |
| 12917 | + | |
| 12918 | + | |
12863 | 12919 |
| |
12864 | 12920 |
| |
12865 | 12921 |
| |
| 12922 | + | |
| 12923 | + | |
| 12924 | + | |
12866 | 12925 |
| |
12867 | 12926 |
| |
12868 | 12927 |
| |
| |||
13202 | 13261 |
| |
13203 | 13262 |
| |
13204 | 13263 |
| |
| 13264 | + | |
| 13265 | + | |
| 13266 | + | |
13205 | 13267 |
| |
13206 | 13268 |
| |
13207 | 13269 |
| |
| |||
13222 | 13284 |
| |
13223 | 13285 |
| |
13224 | 13286 |
| |
| 13287 | + | |
| 13288 | + | |
| 13289 | + | |
13225 | 13290 |
| |
13226 | 13291 |
| |
13227 | 13292 |
| |
| |||
13243 | 13308 |
| |
13244 | 13309 |
| |
13245 | 13310 |
| |
| 13311 | + | |
| 13312 | + | |
| 13313 | + | |
13246 | 13314 |
| |
13247 | 13315 |
| |
13248 | 13316 |
| |
| |||
13271 | 13339 |
| |
13272 | 13340 |
| |
13273 | 13341 |
| |
| 13342 | + | |
| 13343 | + | |
| 13344 | + | |
13274 | 13345 |
| |
13275 | 13346 |
| |
13276 | 13347 |
| |
| |||
13291 | 13362 |
| |
13292 | 13363 |
| |
13293 | 13364 |
| |
| 13365 | + | |
| 13366 | + | |
| 13367 | + | |
13294 | 13368 |
| |
13295 | 13369 |
| |
13296 | 13370 |
| |
| |||
13433 | 13507 |
| |
13434 | 13508 |
| |
13435 | 13509 |
| |
13436 |
| - | |
13437 |
| - | |
13438 |
| - | |
13439 |
| - | |
13440 |
| - | |
| 13510 | + | |
| 13511 | + | |
13441 | 13512 |
| |
13442 | 13513 |
| |
13443 | 13514 |
| |
| |||
13451 | 13522 |
| |
13452 | 13523 |
| |
13453 | 13524 |
| |
| 13525 | + | |
| 13526 | + | |
| 13527 | + | |
| 13528 | + | |
| 13529 | + | |
| 13530 | + | |
| 13531 | + | |
| 13532 | + | |
| 13533 | + | |
| 13534 | + | |
| 13535 | + | |
| 13536 | + | |
| 13537 | + | |
| 13538 | + | |
13454 | 13539 |
| |
13455 | 13540 |
| |
13456 | 13541 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
544 | 544 |
| |
545 | 545 |
| |
546 | 546 |
| |
547 |
| - | |
| 547 | + | |
548 | 548 |
| |
549 | 549 |
| |
550 | 550 |
| |
|
Lines changed: 40 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1287 | 1287 |
| |
1288 | 1288 |
| |
1289 | 1289 |
| |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
1290 | 1330 |
| |
1291 | 1331 |
| |
1292 | 1332 |
| |
|
Lines changed: 20 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
337 | 337 |
| |
338 | 338 |
| |
339 | 339 |
| |
| 340 | + | |
340 | 341 |
| |
341 | 342 |
| |
342 | 343 |
| |
343 |
| - | |
344 |
| - | |
345 |
| - | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
346 | 348 |
| |
347 | 349 |
| |
348 | 350 |
| |
| |||
692 | 694 |
| |
693 | 695 |
| |
694 | 696 |
| |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
695 | 706 |
| |
696 | 707 |
| |
697 | 708 |
| |
| |||
754 | 765 |
| |
755 | 766 |
| |
756 | 767 |
| |
| 768 | + | |
| 769 | + | |
757 | 770 |
| |
758 | 771 |
| |
759 | 772 |
| |
| |||
889 | 902 |
| |
890 | 903 |
| |
891 | 904 |
| |
| 905 | + | |
892 | 906 |
| |
893 | 907 |
| |
894 | 908 |
| |
| |||
913 | 927 |
| |
914 | 928 |
| |
915 | 929 |
| |
916 |
| - | |
| 930 | + | |
| 931 | + | |
917 | 932 |
| |
918 | 933 |
| |
919 | 934 |
| |
| |||
961 | 976 |
| |
962 | 977 |
| |
963 | 978 |
| |
| 979 | + | |
964 | 980 |
| |
965 | 981 |
| |
966 | 982 |
| |
|
0 commit comments
Comments
(0)