Commit 7398e27
committed
Accept fractional seconds in jsonpath's datetime() method.
Commit 927d9ab purported to make datetime() accept any string
that could be output for a datetime value by to_jsonb(). But it
overlooked the possibility of fractional seconds being present,
so that cases as simple as to_jsonb(now()) would defeat it.
Fix by adding formats that include ".US" to the list in
executeDateTimeMethod(). (Note that while this is nominally
microseconds, it'll do the right thing for fractions with
fewer than six digits.)
In passing, re-order the list to restore the datatype ordering
specified in its comment. The violation accidentally did not
break anything; but the next edit might be less lucky, so add
more comments.
Per report from Tim Field. Back-patch to v13 where datetime()
was added, like the previous patch.
Discussion: https://postgr.es/m/014A028B-5CE6-4FDF-AC24-426CA6FC9CEE@mohiohio.com1 parent 0c52437 commit 7398e27
File tree
3 files changed
+31
-4
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+31
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1840 | 1840 | | |
1841 | 1841 | | |
1842 | 1842 | | |
1843 | | - | |
1844 | | - | |
| 1843 | + | |
| 1844 | + | |
1845 | 1845 | | |
1846 | 1846 | | |
1847 | 1847 | | |
1848 | | - | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
1849 | 1851 | | |
1850 | 1852 | | |
| 1853 | + | |
1851 | 1854 | | |
| 1855 | + | |
| 1856 | + | |
1852 | 1857 | | |
1853 | 1858 | | |
1854 | | - | |
| 1859 | + | |
| 1860 | + | |
1855 | 1861 | | |
1856 | 1862 | | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
1857 | 1866 | | |
1858 | 1867 | | |
1859 | 1868 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1920 | 1920 | | |
1921 | 1921 | | |
1922 | 1922 | | |
| 1923 | + | |
| 1924 | + | |
| 1925 | + | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
| 1931 | + | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
1923 | 1938 | | |
1924 | 1939 | | |
1925 | 1940 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
414 | 414 | | |
415 | 415 | | |
416 | 416 | | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
417 | 420 | | |
418 | 421 | | |
419 | 422 | | |
| |||
0 commit comments