forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5eaa05f
committed
Accept fractional seconds in jsonpath's datetime() method.
Commit927d9ab purported to make datetime() accept any stringthat could be output for a datetime value by to_jsonb(). But itoverlooked 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 inexecuteDateTimeMethod(). (Note that while this is nominallymicroseconds, it'll do the right thing for fractions withfewer than six digits.)In passing, re-order the list to restore the datatype orderingspecified in its comment. The violation accidentally did notbreak anything; but the next edit might be less lucky, so addmore 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 parente0e6829 commit5eaa05f
File tree
3 files changed
+31
-4
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+31
-4
lines changedLines changed: 13 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1838 | 1838 |
| |
1839 | 1839 |
| |
1840 | 1840 |
| |
1841 |
| - | |
1842 |
| - | |
| 1841 | + | |
| 1842 | + | |
1843 | 1843 |
| |
1844 | 1844 |
| |
1845 | 1845 |
| |
1846 |
| - | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
1847 | 1849 |
| |
1848 | 1850 |
| |
| 1851 | + | |
1849 | 1852 |
| |
| 1853 | + | |
| 1854 | + | |
1850 | 1855 |
| |
1851 | 1856 |
| |
1852 |
| - | |
| 1857 | + | |
| 1858 | + | |
1853 | 1859 |
| |
1854 | 1860 |
| |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
1855 | 1864 |
| |
1856 | 1865 |
| |
1857 | 1866 |
| |
|
Lines changed: 15 additions & 0 deletions
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 |
| |
|
Lines changed: 3 additions & 0 deletions
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
Comments
(0)