forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitcf98467
committed
Improve behavior of to_timestamp()/to_date() functions
to_timestamp()/to_date() functions were introduced mainly for Oraclecompatibility, and became very popular among PostgreSQL users. However, somebehavior of to_timestamp()/to_date() functions are both incompatible with Oracleand confusing for our users. This behavior is related to handling of spaces andseparators in non FX (fixed format) mode. This commit reworks this behaviormaking less confusing, better documented and more compatible with Oracle.Nevertheless, there are still following incompatibilities with Oracle.1) We don't insist that there are no format string patterns unmatched to input string.2) In FX mode we don't insist space and separators in format string to exactly match input string.3) When format string patterns are divided by mix of spaces and separators, we don't distinguish them, while Oracle takes into account only last group of spaces/separators.Discussion:https://postgr.es/m/1873520224.1784572.1465833145330.JavaMail.yahoo%40mail.yahoo.comAuthor: Artur Zakirov, Alexander Korotkov, Liudmila MantrovaReview: Amul Sul, Robert Haas, Tom Lane, Dmitry Dolgov, David G. Johnston1 parent5f08acc commitcf98467
File tree
4 files changed
+280
-26
lines changed- doc/src/sgml
- src
- backend/utils/adt
- test/regress
- expected
- sql
4 files changed
+280
-26
lines changedLines changed: 58 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6262 | 6262 |
| |
6263 | 6263 |
| |
6264 | 6264 |
| |
6265 |
| - | |
6266 |
| - | |
6267 |
| - | |
| 6265 | + | |
| 6266 | + | |
| 6267 | + | |
| 6268 | + | |
6268 | 6269 |
| |
6269 |
| - | |
| 6270 | + | |
6270 | 6271 |
| |
6271 | 6272 |
| |
6272 | 6273 |
| |
6273 | 6274 |
| |
6274 | 6275 |
| |
| 6276 | + | |
| 6277 | + | |
| 6278 | + | |
| 6279 | + | |
| 6280 | + | |
| 6281 | + | |
| 6282 | + | |
| 6283 | + | |
| 6284 | + | |
| 6285 | + | |
| 6286 | + | |
| 6287 | + | |
| 6288 | + | |
| 6289 | + | |
| 6290 | + | |
| 6291 | + | |
| 6292 | + | |
| 6293 | + | |
| 6294 | + | |
| 6295 | + | |
| 6296 | + | |
| 6297 | + | |
| 6298 | + | |
| 6299 | + | |
| 6300 | + | |
| 6301 | + | |
| 6302 | + | |
| 6303 | + | |
| 6304 | + | |
| 6305 | + | |
| 6306 | + | |
| 6307 | + | |
| 6308 | + | |
| 6309 | + | |
| 6310 | + | |
| 6311 | + | |
| 6312 | + | |
| 6313 | + | |
| 6314 | + | |
| 6315 | + | |
6275 | 6316 |
| |
6276 | 6317 |
| |
6277 | 6318 |
| |
| |||
6287 | 6328 |
| |
6288 | 6329 |
| |
6289 | 6330 |
| |
| 6331 | + | |
| 6332 | + | |
| 6333 | + | |
| 6334 | + | |
| 6335 | + | |
| 6336 | + | |
| 6337 | + | |
| 6338 | + | |
| 6339 | + | |
| 6340 | + | |
| 6341 | + | |
| 6342 | + | |
| 6343 | + | |
6290 | 6344 |
| |
6291 | 6345 |
| |
6292 | 6346 |
| |
|
Lines changed: 98 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
165 | 165 |
| |
166 | 166 |
| |
167 | 167 |
| |
| 168 | + | |
| 169 | + | |
168 | 170 |
| |
169 | 171 |
| |
170 | 172 |
| |
| |||
955 | 957 |
| |
956 | 958 |
| |
957 | 959 |
| |
| 960 | + | |
958 | 961 |
| |
959 | 962 |
| |
960 | 963 |
| |
| |||
1044 | 1047 |
| |
1045 | 1048 |
| |
1046 | 1049 |
| |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
1047 | 1060 |
| |
1048 | 1061 |
| |
1049 | 1062 |
| |
| |||
1319 | 1332 |
| |
1320 | 1333 |
| |
1321 | 1334 |
| |
1322 |
| - | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
1323 | 1343 |
| |
1324 | 1344 |
| |
1325 | 1345 |
| |
| |||
2987 | 3007 |
| |
2988 | 3008 |
| |
2989 | 3009 |
| |
| 3010 | + | |
| 3011 | + | |
2990 | 3012 |
| |
2991 | 3013 |
| |
2992 | 3014 |
| |
2993 |
| - | |
| 3015 | + | |
| 3016 | + | |
| 3017 | + | |
| 3018 | + | |
| 3019 | + | |
| 3020 | + | |
| 3021 | + | |
| 3022 | + | |
| 3023 | + | |
| 3024 | + | |
| 3025 | + | |
| 3026 | + | |
| 3027 | + | |
| 3028 | + | |
| 3029 | + | |
| 3030 | + | |
| 3031 | + | |
| 3032 | + | |
| 3033 | + | |
| 3034 | + | |
| 3035 | + | |
| 3036 | + | |
| 3037 | + | |
| 3038 | + | |
| 3039 | + | |
| 3040 | + | |
| 3041 | + | |
| 3042 | + | |
| 3043 | + | |
| 3044 | + | |
| 3045 | + | |
| 3046 | + | |
| 3047 | + | |
| 3048 | + | |
| 3049 | + | |
| 3050 | + | |
| 3051 | + | |
| 3052 | + | |
| 3053 | + | |
| 3054 | + | |
| 3055 | + | |
| 3056 | + | |
| 3057 | + | |
| 3058 | + | |
2994 | 3059 |
| |
2995 | 3060 |
| |
2996 |
| - | |
2997 |
| - | |
2998 |
| - | |
| 3061 | + | |
| 3062 | + | |
| 3063 | + | |
| 3064 | + | |
2999 | 3065 |
| |
3000 | 3066 |
| |
3001 | 3067 |
| |
3002 | 3068 |
| |
3003 | 3069 |
| |
3004 |
| - | |
3005 |
| - | |
3006 |
| - | |
3007 |
| - | |
3008 |
| - | |
3009 |
| - | |
3010 |
| - | |
3011 | 3070 |
| |
3012 | 3071 |
| |
3013 | 3072 |
| |
| |||
3086 | 3145 |
| |
3087 | 3146 |
| |
3088 | 3147 |
| |
3089 |
| - | |
3090 |
| - | |
| 3148 | + | |
| 3149 | + | |
| 3150 | + | |
| 3151 | + | |
| 3152 | + | |
| 3153 | + | |
3091 | 3154 |
| |
| 3155 | + | |
| 3156 | + | |
3092 | 3157 |
| |
| 3158 | + | |
| 3159 | + | |
| 3160 | + | |
| 3161 | + | |
| 3162 | + | |
| 3163 | + | |
| 3164 | + | |
| 3165 | + | |
3093 | 3166 |
| |
3094 | 3167 |
| |
3095 | 3168 |
| |
| |||
3261 | 3334 |
| |
3262 | 3335 |
| |
3263 | 3336 |
| |
| 3337 | + | |
| 3338 | + | |
| 3339 | + | |
| 3340 | + | |
| 3341 | + | |
| 3342 | + | |
| 3343 | + | |
| 3344 | + | |
| 3345 | + | |
| 3346 | + | |
| 3347 | + | |
3264 | 3348 |
| |
3265 | 3349 |
| |
3266 | 3350 |
| |
|
0 commit comments
Comments
(0)