Commit 6dda292
committed
Allow datetime values in JsonbValue
SQL/JSON standard allows manipulation with datetime values. So, it appears to
be convinient to allow datetime values to be represented in JsonbValue struct.
These datetime values are allowed for temporary representation only. During
serialization datetime values are converted into strings.
SQL/JSON requires writing timestamps with timezone in the same timezone offset
as they were parsed. This is why we allow storage of timezone offset in
JsonbValue struct. For the same reason timezone offset argument is added to
JsonEncodeDateTime() function.
Extracted from original patch by Nikita Glukhov, Teodor Sigaev, Oleg Bartunov.
Revised by me. Comments were adjusted by Liudmila Mantrova.
Discussion: https://postgr.es/m/fcc6fc6a-b497-f39a-923d-aa34d0c588e8%402ndQuadrant.com
Discussion: https://postgr.es/m/CAPpHfdsZgYEra_PeCLGNoXOWYx6iU-S3wF8aX0ObQUcZU%2B4XTw%40mail.gmail.com
Author: Nikita Glukhov, Teodor Sigaev, Oleg Bartunov, Alexander Korotkov, Liudmila Mantrova
Reviewed-by: Anastasia Lubennikova, Peter Eisentraut1 parent 5bc4506 commit 6dda292
File tree
5 files changed
+94
-13
lines changed- src
- backend/utils/adt
- include/utils
5 files changed
+94
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1506 | 1506 | | |
1507 | 1507 | | |
1508 | 1508 | | |
1509 | | - | |
| 1509 | + | |
1510 | 1510 | | |
1511 | 1511 | | |
1512 | 1512 | | |
1513 | 1513 | | |
1514 | 1514 | | |
1515 | 1515 | | |
1516 | 1516 | | |
1517 | | - | |
| 1517 | + | |
1518 | 1518 | | |
1519 | 1519 | | |
1520 | 1520 | | |
1521 | 1521 | | |
1522 | 1522 | | |
1523 | 1523 | | |
1524 | 1524 | | |
1525 | | - | |
| 1525 | + | |
1526 | 1526 | | |
1527 | 1527 | | |
1528 | 1528 | | |
| |||
1550 | 1550 | | |
1551 | 1551 | | |
1552 | 1552 | | |
1553 | | - | |
| 1553 | + | |
| 1554 | + | |
1554 | 1555 | | |
1555 | 1556 | | |
1556 | | - | |
| 1557 | + | |
1557 | 1558 | | |
1558 | 1559 | | |
1559 | 1560 | | |
| |||
1630 | 1631 | | |
1631 | 1632 | | |
1632 | 1633 | | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
1633 | 1647 | | |
1634 | 1648 | | |
1635 | 1649 | | |
1636 | | - | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
1637 | 1656 | | |
| 1657 | + | |
1638 | 1658 | | |
1639 | 1659 | | |
1640 | 1660 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
209 | 227 | | |
210 | 228 | | |
211 | 229 | | |
| |||
805 | 823 | | |
806 | 824 | | |
807 | 825 | | |
808 | | - | |
| 826 | + | |
| 827 | + | |
809 | 828 | | |
810 | 829 | | |
811 | 830 | | |
812 | 831 | | |
813 | | - | |
| 832 | + | |
| 833 | + | |
814 | 834 | | |
815 | 835 | | |
816 | 836 | | |
817 | 837 | | |
818 | | - | |
| 838 | + | |
| 839 | + | |
819 | 840 | | |
820 | 841 | | |
821 | 842 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
| 20 | + | |
19 | 21 | | |
| 22 | + | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
| |||
244 | 247 | | |
245 | 248 | | |
246 | 249 | | |
| 250 | + | |
| 251 | + | |
247 | 252 | | |
248 | 253 | | |
249 | 254 | | |
| |||
1786 | 1791 | | |
1787 | 1792 | | |
1788 | 1793 | | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
1789 | 1810 | | |
1790 | 1811 | | |
1791 | 1812 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
| 165 | + | |
165 | 166 | | |
166 | 167 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
245 | 253 | | |
246 | 254 | | |
247 | 255 | | |
| |||
282 | 290 | | |
283 | 291 | | |
284 | 292 | | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
285 | 302 | | |
286 | 303 | | |
287 | 304 | | |
288 | | - | |
289 | | - | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
290 | 308 | | |
291 | 309 | | |
292 | 310 | | |
| |||
0 commit comments