forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8ba6fdf
committed
Support TZ and OF format codes in to_timestamp().
Formerly, these were only supported in to_char(), but there seemslittle reason for that restriction. We should at least have enoughsupport to permit round-tripping the output of to_char().In that spirit, TZ accepts either zone abbreviations or numeric(HH or HH:MM) offsets, which are the cases that to_char() can output.In an ideal world we'd make it take full zone names too, butthat seems like it'd introduce an unreasonable amount of ambiguity,since the rules for POSIX-spec zone names are so lax.OF is a subset of this, accepting only HH or HH:MM.One small benefit of this improvement is that we can simplifyjsonpath's executeDateTimeMethod function, which no longer needsto consider the HH and HH:MM cases separately. Moreover, lettingit accept zone abbreviations means it will accept "Z" to mean UTC,which is emitted by JSON.stringify() for example.Patch by me, reviewed by Aleksander Alekseev and Daniel GustafssonDiscussion:https://postgr.es/m/1681086.1686673242@sss.pgh.pa.us1 parent06a66d8 commit8ba6fdf
File tree
9 files changed
+318
-74
lines changed- doc/src/sgml
- src
- backend/utils/adt
- include/utils
- test/regress
- expected
- sql
9 files changed
+318
-74
lines changedLines changed: 4 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8131 | 8131 |
| |
8132 | 8132 |
| |
8133 | 8133 |
| |
8134 |
| - | |
8135 |
| - | |
| 8134 | + | |
8136 | 8135 |
| |
8137 | 8136 |
| |
8138 | 8137 |
| |
8139 |
| - | |
8140 |
| - | |
| 8138 | + | |
8141 | 8139 |
| |
8142 | 8140 |
| |
8143 | 8141 |
| |
| |||
8149 | 8147 |
| |
8150 | 8148 |
| |
8151 | 8149 |
| |
8152 |
| - | |
8153 |
| - | |
| 8150 | + | |
| 8151 | + | |
8154 | 8152 |
| |
8155 | 8153 |
| |
8156 | 8154 |
| |
|
Lines changed: 76 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3246 | 3246 |
| |
3247 | 3247 |
| |
3248 | 3248 |
| |
| 3249 | + | |
| 3250 | + | |
| 3251 | + | |
| 3252 | + | |
| 3253 | + | |
| 3254 | + | |
| 3255 | + | |
| 3256 | + | |
| 3257 | + | |
| 3258 | + | |
| 3259 | + | |
| 3260 | + | |
| 3261 | + | |
| 3262 | + | |
| 3263 | + | |
| 3264 | + | |
| 3265 | + | |
| 3266 | + | |
| 3267 | + | |
| 3268 | + | |
| 3269 | + | |
| 3270 | + | |
| 3271 | + | |
| 3272 | + | |
| 3273 | + | |
| 3274 | + | |
| 3275 | + | |
| 3276 | + | |
| 3277 | + | |
| 3278 | + | |
| 3279 | + | |
| 3280 | + | |
| 3281 | + | |
| 3282 | + | |
| 3283 | + | |
| 3284 | + | |
| 3285 | + | |
| 3286 | + | |
| 3287 | + | |
| 3288 | + | |
| 3289 | + | |
| 3290 | + | |
| 3291 | + | |
| 3292 | + | |
| 3293 | + | |
| 3294 | + | |
| 3295 | + | |
| 3296 | + | |
| 3297 | + | |
| 3298 | + | |
| 3299 | + | |
| 3300 | + | |
| 3301 | + | |
| 3302 | + | |
| 3303 | + | |
| 3304 | + | |
| 3305 | + | |
| 3306 | + | |
| 3307 | + | |
| 3308 | + | |
| 3309 | + | |
| 3310 | + | |
| 3311 | + | |
| 3312 | + | |
| 3313 | + | |
| 3314 | + | |
| 3315 | + | |
| 3316 | + | |
| 3317 | + | |
| 3318 | + | |
| 3319 | + | |
| 3320 | + | |
| 3321 | + | |
| 3322 | + | |
| 3323 | + | |
| 3324 | + | |
3249 | 3325 |
| |
3250 | 3326 |
| |
3251 | 3327 |
| |
|
0 commit comments
Comments
(0)