aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/postgresql/cases/horology.err
blob: 55741efc1f874ee2560df2650cb312021ad96ac2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
Registering pre-existing tables
	TIME_TBL
	TIMESTAMPTZ_TBL
	TIMESTAMP_TBL
	INTERVAL_TBL
	TIMETZ_TBL
<sql-statement>
--
-- HOROLOGY
--
SET DateStyle = 'Postgres, MDY';
</sql-statement>
<sql-statement>
SHOW TimeZone;  -- Many of these tests depend on the prevailing setting
</sql-statement>
-stdin-:<main>: Error: Parse Sql

    -stdin-:<main>:1:1: Error: unrecognized configuration parameter "timezone"
    	SHOW TimeZone;  -- Many of these tests depend on the prevailing setting
	^
<sql-statement>
--
-- Test various input formats
--
SELECT timestamp with time zone '20011227 040506+08';
</sql-statement>
<sql-statement>
SELECT timestamp with time zone '20011227 040506-08';
</sql-statement>
<sql-statement>
SELECT timestamp with time zone '20011227 040506.789+08';
</sql-statement>
<sql-statement>
SELECT timestamp with time zone '20011227 040506.789-08';
</sql-statement>
<sql-statement>
SELECT timestamp with time zone '20011227T040506+08';
</sql-statement>
<sql-statement>
SELECT timestamp with time zone '20011227T040506-08';
</sql-statement>
<sql-statement>
SELECT timestamp with time zone '20011227T040506.789+08';
</sql-statement>
<sql-statement>
SELECT timestamp with time zone '20011227T040506.789-08';
</sql-statement>
<sql-statement>
SELECT timestamp with time zone '2001-12-27 04:05:06.789-08';
</sql-statement>
<sql-statement>
SELECT timestamp with time zone '2001.12.27 04:05:06.789-08';
</sql-statement>
<sql-statement>
SELECT timestamp with time zone '2001/12/27 04:05:06.789-08';
</sql-statement>
<sql-statement>
SELECT timestamp with time zone '12/27/2001 04:05:06.789-08';
</sql-statement>
<sql-statement>
-- should fail in mdy mode:
SELECT timestamp with time zone '27/12/2001 04:05:06.789-08';
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	-- should fail in mdy mode:
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  date/time field value out of range: "27/12/2001 04:05:06.789-08"
HINT:  Perhaps you need a different "datestyle" setting.

        	-- should fail in mdy mode:
	^
<sql-statement>
set datestyle to dmy;
</sql-statement>
<sql-statement>
SELECT timestamp with time zone '27/12/2001 04:05:06.789-08';
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	SELECT timestamp with time zone '27/12/2001 04:05:06.789-08';
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  date/time field value out of range: "27/12/2001 04:05:06.789-08"
HINT:  Perhaps you need a different "datestyle" setting.

        	SELECT timestamp with time zone '27/12/2001 04:05:06.789-08';
	^
<sql-statement>
reset datestyle;
</sql-statement>
<sql-statement>
SELECT timestamp with time zone 'Y2001M12D27H04M05S06.789+08';
</sql-statement>
<sql-statement>
SELECT timestamp with time zone 'Y2001M12D27H04M05S06.789-08';
</sql-statement>
<sql-statement>
SELECT timestamp with time zone 'Y2001M12D27H04MM05S06.789+08';
</sql-statement>
<sql-statement>
SELECT timestamp with time zone 'Y2001M12D27H04MM05S06.789-08';
</sql-statement>
<sql-statement>
SELECT timestamp with time zone 'J2452271+08';
</sql-statement>
<sql-statement>
SELECT timestamp with time zone 'J2452271-08';
</sql-statement>
<sql-statement>
SELECT timestamp with time zone 'J2452271.5+08';
</sql-statement>
<sql-statement>
SELECT timestamp with time zone 'J2452271.5-08';
</sql-statement>
<sql-statement>
SELECT timestamp with time zone 'J2452271 04:05:06+08';
</sql-statement>
<sql-statement>
SELECT timestamp with time zone 'J2452271 04:05:06-08';
</sql-statement>
<sql-statement>
SELECT timestamp with time zone 'J2452271T040506+08';
</sql-statement>
<sql-statement>
SELECT timestamp with time zone 'J2452271T040506-08';
</sql-statement>
<sql-statement>
SELECT timestamp with time zone 'J2452271T040506.789+08';
</sql-statement>
<sql-statement>
SELECT timestamp with time zone 'J2452271T040506.789-08';
</sql-statement>
<sql-statement>
-- German/European-style dates with periods as delimiters
SELECT timestamp with time zone '12.27.2001 04:05:06.789+08';
</sql-statement>
<sql-statement>
SELECT timestamp with time zone '12.27.2001 04:05:06.789-08';
</sql-statement>
<sql-statement>
SET DateStyle = 'German';
</sql-statement>
<sql-statement>
SELECT timestamp with time zone '27.12.2001 04:05:06.789+08';
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	SELECT timestamp with time zone '27.12.2001 04:05:06.789+08';
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  date/time field value out of range: "27.12.2001 04:05:06.789+08"
HINT:  Perhaps you need a different "datestyle" setting.

        	SELECT timestamp with time zone '27.12.2001 04:05:06.789+08';
	^
<sql-statement>
SELECT timestamp with time zone '27.12.2001 04:05:06.789-08';
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	SELECT timestamp with time zone '27.12.2001 04:05:06.789-08';
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  date/time field value out of range: "27.12.2001 04:05:06.789-08"
HINT:  Perhaps you need a different "datestyle" setting.

        	SELECT timestamp with time zone '27.12.2001 04:05:06.789-08';
	^
<sql-statement>
SET DateStyle = 'ISO';
</sql-statement>
<sql-statement>
-- As of 7.4, allow time without time zone having a time zone specified
SELECT time without time zone '040506.789+08';
</sql-statement>
<sql-statement>
SELECT time without time zone '040506.789-08';
</sql-statement>
<sql-statement>
SELECT time without time zone 'T040506.789+08';
</sql-statement>
<sql-statement>
SELECT time without time zone 'T040506.789-08';
</sql-statement>
<sql-statement>
SELECT time with time zone '040506.789+08';
</sql-statement>
<sql-statement>
SELECT time with time zone '040506.789-08';
</sql-statement>
<sql-statement>
SELECT time with time zone 'T040506.789+08';
</sql-statement>
<sql-statement>
SELECT time with time zone 'T040506.789-08';
</sql-statement>
<sql-statement>
SELECT time with time zone 'T040506.789 +08';
</sql-statement>
<sql-statement>
SELECT time with time zone 'T040506.789 -08';
</sql-statement>
<sql-statement>
SET DateStyle = 'Postgres, MDY';
</sql-statement>
<sql-statement>
-- Check Julian dates BC
SELECT date 'J1520447' AS "Confucius' Birthday";
</sql-statement>
<sql-statement>
SELECT date 'J0' AS "Julian Epoch";
</sql-statement>
<sql-statement>
--
-- date, time arithmetic
--
SELECT date '1981-02-03' + time '04:05:06' AS "Date + Time";
</sql-statement>
<sql-statement>
SELECT date '1991-02-03' + time with time zone '04:05:06 PST' AS "Date + Time PST";
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	SELECT date '1991-02-03' + time with time zone '04:05:06 PST' AS "Date + Time PST";
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  invalid input syntax for type time with time zone: "04:05:06 PST"

        	SELECT date '1991-02-03' + time with time zone '04:05:06 PST' AS "Date + Time PST";
	^
<sql-statement>
SELECT date '2001-02-03' + time with time zone '04:05:06 UTC' AS "Date + Time UTC";
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	SELECT date '2001-02-03' + time with time zone '04:05:06 UTC' AS "Date + Time UTC";
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  invalid input syntax for type time with time zone: "04:05:06 UTC"

        	SELECT date '2001-02-03' + time with time zone '04:05:06 UTC' AS "Date + Time UTC";
	^
<sql-statement>
SELECT date '1991-02-03' + interval '2 years' AS "Add Two Years";
</sql-statement>
<sql-statement>
SELECT date '2001-12-13' - interval '2 years' AS "Subtract Two Years";
</sql-statement>
<sql-statement>
-- subtract time from date should not make sense; use interval instead
SELECT date '1991-02-03' - time '04:05:06' AS "Subtract Time";
</sql-statement>
<sql-statement>
SELECT date '1991-02-03' - time with time zone '04:05:06 UTC' AS "Subtract Time UTC";
</sql-statement>
-stdin-:<main>: Error: Type annotation

    -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
    	SELECT date '1991-02-03' - time with time zone '04:05:06 UTC' AS "Subtract Time UTC";
	^
        -stdin-:<main>:1:26: Error: At function: PgOp
        	SELECT date '1991-02-03' - time with time zone '04:05:06 UTC' AS "Subtract Time UTC";
	                         ^
            -stdin-:<main>:1:26: Error: Unable to find an overload for operator - with given argument type(s): (date,timetz)
            	SELECT date '1991-02-03' - time with time zone '04:05:06 UTC' AS "Subtract Time UTC";
	                         ^
<sql-statement>
--
-- timestamp, interval arithmetic
--
SELECT timestamp without time zone '1996-03-01' - interval '1 second' AS "Feb 29";
</sql-statement>
<sql-statement>
SELECT timestamp without time zone '1999-03-01' - interval '1 second' AS "Feb 28";
</sql-statement>
<sql-statement>
SELECT timestamp without time zone '2000-03-01' - interval '1 second' AS "Feb 29";
</sql-statement>
<sql-statement>
SELECT timestamp without time zone '1999-12-01' + interval '1 month - 1 second' AS "Dec 31";
</sql-statement>
<sql-statement>
SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '106000000 days' AS "Feb 23, 285506";
</sql-statement>
<sql-statement>
SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '107000000 days' AS "Jan 20, 288244";
</sql-statement>
<sql-statement>
SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '109203489 days' AS "Dec 31, 294276";
</sql-statement>
<sql-statement>
SELECT timestamp without time zone '12/31/294276' - timestamp without time zone '12/23/1999' AS "106751991 Days";
</sql-statement>
<sql-statement>
-- Shorthand values
-- Not directly usable for regression testing since these are not constants.
-- So, just try to test parser and hope for the best - thomas 97/04/26
SELECT (timestamp without time zone 'today' = (timestamp without time zone 'yesterday' + interval '1 day')) as "True";
</sql-statement>
<sql-statement>
SELECT (timestamp without time zone 'today' = (timestamp without time zone 'tomorrow' - interval '1 day')) as "True";
</sql-statement>
<sql-statement>
SELECT (timestamp without time zone 'today 10:30' = (timestamp without time zone 'yesterday' + interval '1 day 10 hr 30 min')) as "True";
</sql-statement>
<sql-statement>
SELECT (timestamp without time zone '10:30 today' = (timestamp without time zone 'yesterday' + interval '1 day 10 hr 30 min')) as "True";
</sql-statement>
<sql-statement>
SELECT (timestamp without time zone 'tomorrow' = (timestamp without time zone 'yesterday' + interval '2 days')) as "True";
</sql-statement>
<sql-statement>
SELECT (timestamp without time zone 'tomorrow 16:00:00' = (timestamp without time zone 'today' + interval '1 day 16 hours')) as "True";
</sql-statement>
<sql-statement>
SELECT (timestamp without time zone '16:00:00 tomorrow' = (timestamp without time zone 'today' + interval '1 day 16 hours')) as "True";
</sql-statement>
<sql-statement>
SELECT (timestamp without time zone 'yesterday 12:34:56' = (timestamp without time zone 'tomorrow' - interval '2 days - 12:34:56')) as "True";
</sql-statement>
<sql-statement>
SELECT (timestamp without time zone '12:34:56 yesterday' = (timestamp without time zone 'tomorrow' - interval '2 days - 12:34:56')) as "True";
</sql-statement>
<sql-statement>
SELECT (timestamp without time zone 'tomorrow' > 'now') as "True";
</sql-statement>
<sql-statement>
-- Convert from date and time to timestamp
-- This test used to be timestamp(date,time) but no longer allowed by grammar
-- to enable support for SQL99 timestamp type syntax.
SELECT date '1994-01-01' + time '11:00' AS "Jan_01_1994_11am";
</sql-statement>
<sql-statement>
SELECT date '1994-01-01' + time '10:00' AS "Jan_01_1994_10am";
</sql-statement>
<sql-statement>
SELECT date '1994-01-01' + timetz '11:00-5' AS "Jan_01_1994_8am";
</sql-statement>
<sql-statement>
SELECT timestamptz(date '1994-01-01', time with time zone '11:00-5') AS "Jan_01_1994_8am";
</sql-statement>
<sql-statement>
SELECT d1 + interval '1 year' AS one_year FROM TIMESTAMP_TBL;
</sql-statement>
<sql-statement>
SELECT d1 - interval '1 year' AS one_year FROM TIMESTAMP_TBL;
</sql-statement>
<sql-statement>
SELECT timestamp with time zone '1996-03-01' - interval '1 second' AS "Feb 29";
</sql-statement>
<sql-statement>
SELECT timestamp with time zone '1999-03-01' - interval '1 second' AS "Feb 28";
</sql-statement>
<sql-statement>
SELECT timestamp with time zone '2000-03-01' - interval '1 second' AS "Feb 29";
</sql-statement>
<sql-statement>
SELECT timestamp with time zone '1999-12-01' + interval '1 month - 1 second' AS "Dec 31";
</sql-statement>
<sql-statement>
SELECT (timestamp with time zone 'today' = (timestamp with time zone 'yesterday' + interval '1 day')) as "True";
</sql-statement>
<sql-statement>
SELECT (timestamp with time zone 'today' = (timestamp with time zone 'tomorrow' - interval '1 day')) as "True";
</sql-statement>
<sql-statement>
SELECT (timestamp with time zone 'tomorrow' = (timestamp with time zone 'yesterday' + interval '2 days')) as "True";
</sql-statement>
<sql-statement>
SELECT (timestamp with time zone 'tomorrow' > 'now') as "True";
</sql-statement>
<sql-statement>
-- timestamp with time zone, interval arithmetic around DST change
-- (just for fun, let's use an intentionally nonstandard POSIX zone spec)
SET TIME ZONE 'CST7CDT,M4.1.0,M10.5.0';
</sql-statement>
<sql-statement>
SELECT timestamp with time zone '2005-04-02 12:00-07' + interval '1 day' as "Apr 3, 12:00";
</sql-statement>
<sql-statement>
SELECT timestamp with time zone '2005-04-02 12:00-07' + interval '24 hours' as "Apr 3, 13:00";
</sql-statement>
<sql-statement>
SELECT timestamp with time zone '2005-04-03 12:00-06' - interval '1 day' as "Apr 2, 12:00";
</sql-statement>
<sql-statement>
SELECT timestamp with time zone '2005-04-03 12:00-06' - interval '24 hours' as "Apr 2, 11:00";
</sql-statement>
<sql-statement>
RESET TIME ZONE;
</sql-statement>
<sql-statement>
SELECT timestamptz(date '1994-01-01', time '11:00') AS "Jan_01_1994_10am";
</sql-statement>
<sql-statement>
SELECT timestamptz(date '1994-01-01', time '10:00') AS "Jan_01_1994_9am";
</sql-statement>
<sql-statement>
SELECT timestamptz(date '1994-01-01', time with time zone '11:00-8') AS "Jan_01_1994_11am";
</sql-statement>
<sql-statement>
SELECT timestamptz(date '1994-01-01', time with time zone '10:00-8') AS "Jan_01_1994_10am";
</sql-statement>
<sql-statement>
SELECT timestamptz(date '1994-01-01', time with time zone '11:00-5') AS "Jan_01_1994_8am";
</sql-statement>
<sql-statement>
SELECT d1 + interval '1 year' AS one_year FROM TIMESTAMPTZ_TBL;
</sql-statement>
<sql-statement>
SELECT d1 - interval '1 year' AS one_year FROM TIMESTAMPTZ_TBL;
</sql-statement>
<sql-statement>
--
-- time, interval arithmetic
--
SELECT CAST(time '01:02' AS interval) AS "+01:02";
</sql-statement>
<sql-statement>
SELECT CAST(interval '02:03' AS time) AS "02:03:00";
</sql-statement>
<sql-statement>
SELECT time '01:30' + interval '02:01' AS "03:31:00";
</sql-statement>
<sql-statement>
SELECT time '01:30' - interval '02:01' AS "23:29:00";
</sql-statement>
<sql-statement>
SELECT time '02:30' + interval '36:01' AS "14:31:00";
</sql-statement>
<sql-statement>
SELECT time '03:30' + interval '1 month 04:01' AS "07:31:00";
</sql-statement>
<sql-statement>
SELECT CAST(time with time zone '01:02-08' AS interval) AS "+00:01";
</sql-statement>
-stdin-:<main>: Error: Type annotation

    -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
    	SELECT CAST(time with time zone '01:02-08' AS interval) AS "+00:01";
	^
        -stdin-:<main>:1:47: Error: At function: PgCast
        	SELECT CAST(time with time zone '01:02-08' AS interval) AS "+00:01";
	                                              ^
            -stdin-:<main>:1:47: Error: Cannot cast type timetz into type interval
            	SELECT CAST(time with time zone '01:02-08' AS interval) AS "+00:01";
	                                              ^
<sql-statement>
SELECT CAST(interval '02:03' AS time with time zone) AS "02:03:00-08";
</sql-statement>
-stdin-:<main>: Error: Type annotation

    -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
    	SELECT CAST(interval '02:03' AS time with time zone) AS "02:03:00-08";
	^
        -stdin-:<main>:1:33: Error: At function: PgCast
        	SELECT CAST(interval '02:03' AS time with time zone) AS "02:03:00-08";
	                                ^
            -stdin-:<main>:1:33: Error: Cannot cast type interval into type timetz
            	SELECT CAST(interval '02:03' AS time with time zone) AS "02:03:00-08";
	                                ^
<sql-statement>
SELECT time with time zone '01:30-08' - interval '02:01' AS "23:29:00-08";
</sql-statement>
<sql-statement>
SELECT time with time zone '02:30-08' + interval '36:01' AS "14:31:00-08";
</sql-statement>
<sql-statement>
-- These two tests cannot be used because they default to current timezone,
-- which may be either -08 or -07 depending on the time of year.
-- SELECT time with time zone '01:30' + interval '02:01' AS "03:31:00-08";
-- SELECT time with time zone '03:30' + interval '1 month 04:01' AS "07:31:00-08";
-- Try the following two tests instead, as a poor substitute
SELECT CAST(CAST(date 'today' + time with time zone '05:30'
            + interval '02:01' AS time with time zone) AS time) AS "07:31:00";
</sql-statement>
<sql-statement>
SELECT CAST(cast(date 'today' + time with time zone '03:30'
  + interval '1 month 04:01' as timestamp without time zone) AS time) AS "07:31:00";
</sql-statement>
<sql-statement>
SELECT t.d1 AS t, i.f1 AS i, t.d1 + i.f1 AS "add", t.d1 - i.f1 AS "subtract"
  FROM TIMESTAMP_TBL t, INTERVAL_TBL i
  WHERE t.d1 BETWEEN '1990-01-01' AND '2001-01-01'
    AND i.f1 BETWEEN '00:00' AND '23:00'
  ORDER BY 1,2;
</sql-statement>
<sql-statement>
SELECT t.f1 AS t, i.f1 AS i, t.f1 + i.f1 AS "add", t.f1 - i.f1 AS "subtract"
  FROM TIME_TBL t, INTERVAL_TBL i
  ORDER BY 1,2;
</sql-statement>
<sql-statement>
SELECT t.f1 AS t, i.f1 AS i, t.f1 + i.f1 AS "add", t.f1 - i.f1 AS "subtract"
  FROM TIMETZ_TBL t, INTERVAL_TBL i
  ORDER BY 1,2;
</sql-statement>
<sql-statement>
-- SQL9x OVERLAPS operator
-- test with time zone
SELECT (timestamp with time zone '2000-11-27', timestamp with time zone '2000-11-28')
  OVERLAPS (timestamp with time zone '2000-11-27 12:00', timestamp with time zone '2000-11-30') AS "True";
</sql-statement>
<sql-statement>
SELECT (timestamp with time zone '2000-11-26', timestamp with time zone '2000-11-27')
  OVERLAPS (timestamp with time zone '2000-11-27 12:00', timestamp with time zone '2000-11-30') AS "False";
</sql-statement>
<sql-statement>
SELECT (timestamp with time zone '2000-11-27', timestamp with time zone '2000-11-28')
  OVERLAPS (timestamp with time zone '2000-11-27 12:00', interval '1 day') AS "True";
</sql-statement>
-stdin-:<main>: Error: Type annotation

    -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
    	SELECT (timestamp with time zone '2000-11-27', timestamp with time zone '2000-11-28')
	^
        -stdin-:<main>:2:3: Error: At function: PgCall
        	  OVERLAPS (timestamp with time zone '2000-11-27 12:00', interval '1 day') AS "True";
	  ^
            -stdin-:<main>:2:3: Error: Unable to find an overload for proc overlaps with given argument types: (timestamptz,timestamptz,timestamptz,interval)
            	  OVERLAPS (timestamp with time zone '2000-11-27 12:00', interval '1 day') AS "True";
	  ^
<sql-statement>
SELECT (timestamp with time zone '2000-11-27', interval '12 hours')
  OVERLAPS (timestamp with time zone '2000-11-27 12:00', timestamp with time zone '2000-11-30') AS "False";
</sql-statement>
-stdin-:<main>: Error: Type annotation

    -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
    	SELECT (timestamp with time zone '2000-11-27', interval '12 hours')
	^
        -stdin-:<main>:2:3: Error: At function: PgCall
        	  OVERLAPS (timestamp with time zone '2000-11-27 12:00', timestamp with time zone '2000-11-30') AS "False";
	  ^
            -stdin-:<main>:2:3: Error: Unable to find an overload for proc overlaps with given argument types: (timestamptz,interval,timestamptz,timestamptz)
            	  OVERLAPS (timestamp with time zone '2000-11-27 12:00', timestamp with time zone '2000-11-30') AS "False";
	  ^
<sql-statement>
SELECT (timestamp with time zone '2000-11-27', interval '12 hours')
  OVERLAPS (timestamp with time zone '2000-11-27', interval '12 hours') AS "True";
</sql-statement>
-stdin-:<main>: Error: Type annotation

    -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
    	SELECT (timestamp with time zone '2000-11-27', interval '12 hours')
	^
        -stdin-:<main>:2:3: Error: At function: PgCall
        	  OVERLAPS (timestamp with time zone '2000-11-27', interval '12 hours') AS "True";
	  ^
            -stdin-:<main>:2:3: Error: Unable to find an overload for proc overlaps with given argument types: (timestamptz,interval,timestamptz,interval)
            	  OVERLAPS (timestamp with time zone '2000-11-27', interval '12 hours') AS "True";
	  ^
<sql-statement>
SELECT (timestamp with time zone '2000-11-27', interval '12 hours')
  OVERLAPS (timestamp with time zone '2000-11-27 12:00', interval '12 hours') AS "False";
</sql-statement>
-stdin-:<main>: Error: Type annotation

    -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
    	SELECT (timestamp with time zone '2000-11-27', interval '12 hours')
	^
        -stdin-:<main>:2:3: Error: At function: PgCall
        	  OVERLAPS (timestamp with time zone '2000-11-27 12:00', interval '12 hours') AS "False";
	  ^
            -stdin-:<main>:2:3: Error: Unable to find an overload for proc overlaps with given argument types: (timestamptz,interval,timestamptz,interval)
            	  OVERLAPS (timestamp with time zone '2000-11-27 12:00', interval '12 hours') AS "False";
	  ^
<sql-statement>
-- test without time zone
SELECT (timestamp without time zone '2000-11-27', timestamp without time zone '2000-11-28')
  OVERLAPS (timestamp without time zone '2000-11-27 12:00', timestamp without time zone '2000-11-30') AS "True";
</sql-statement>
<sql-statement>
SELECT (timestamp without time zone '2000-11-26', timestamp without time zone '2000-11-27')
  OVERLAPS (timestamp without time zone '2000-11-27 12:00', timestamp without time zone '2000-11-30') AS "False";
</sql-statement>
<sql-statement>
SELECT (timestamp without time zone '2000-11-27', timestamp without time zone '2000-11-28')
  OVERLAPS (timestamp without time zone '2000-11-27 12:00', interval '1 day') AS "True";
</sql-statement>
-stdin-:<main>: Error: Type annotation

    -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
    	SELECT (timestamp without time zone '2000-11-27', timestamp without time zone '2000-11-28')
	^
        -stdin-:<main>:2:3: Error: At function: PgCall
        	  OVERLAPS (timestamp without time zone '2000-11-27 12:00', interval '1 day') AS "True";
	  ^
            -stdin-:<main>:2:3: Error: Unable to find an overload for proc overlaps with given argument types: (timestamp,timestamp,timestamp,interval)
            	  OVERLAPS (timestamp without time zone '2000-11-27 12:00', interval '1 day') AS "True";
	  ^
<sql-statement>
SELECT (timestamp without time zone '2000-11-27', interval '12 hours')
  OVERLAPS (timestamp without time zone '2000-11-27 12:00', timestamp without time zone '2000-11-30') AS "False";
</sql-statement>
-stdin-:<main>: Error: Type annotation

    -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
    	SELECT (timestamp without time zone '2000-11-27', interval '12 hours')
	^
        -stdin-:<main>:2:3: Error: At function: PgCall
        	  OVERLAPS (timestamp without time zone '2000-11-27 12:00', timestamp without time zone '2000-11-30') AS "False";
	  ^
            -stdin-:<main>:2:3: Error: Unable to find an overload for proc overlaps with given argument types: (timestamp,interval,timestamp,timestamp)
            	  OVERLAPS (timestamp without time zone '2000-11-27 12:00', timestamp without time zone '2000-11-30') AS "False";
	  ^
<sql-statement>
SELECT (timestamp without time zone '2000-11-27', interval '12 hours')
  OVERLAPS (timestamp without time zone '2000-11-27', interval '12 hours') AS "True";
</sql-statement>
-stdin-:<main>: Error: Type annotation

    -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
    	SELECT (timestamp without time zone '2000-11-27', interval '12 hours')
	^
        -stdin-:<main>:2:3: Error: At function: PgCall
        	  OVERLAPS (timestamp without time zone '2000-11-27', interval '12 hours') AS "True";
	  ^
            -stdin-:<main>:2:3: Error: Unable to find an overload for proc overlaps with given argument types: (timestamp,interval,timestamp,interval)
            	  OVERLAPS (timestamp without time zone '2000-11-27', interval '12 hours') AS "True";
	  ^
<sql-statement>
SELECT (timestamp without time zone '2000-11-27', interval '12 hours')
  OVERLAPS (timestamp without time zone '2000-11-27 12:00', interval '12 hours') AS "False";
</sql-statement>
-stdin-:<main>: Error: Type annotation

    -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
    	SELECT (timestamp without time zone '2000-11-27', interval '12 hours')
	^
        -stdin-:<main>:2:3: Error: At function: PgCall
        	  OVERLAPS (timestamp without time zone '2000-11-27 12:00', interval '12 hours') AS "False";
	  ^
            -stdin-:<main>:2:3: Error: Unable to find an overload for proc overlaps with given argument types: (timestamp,interval,timestamp,interval)
            	  OVERLAPS (timestamp without time zone '2000-11-27 12:00', interval '12 hours') AS "False";
	  ^
<sql-statement>
-- test time and interval
SELECT (time '00:00', time '01:00')
  OVERLAPS (time '00:30', time '01:30') AS "True";
</sql-statement>
<sql-statement>
SELECT (time '00:00', interval '1 hour')
  OVERLAPS (time '00:30', interval '1 hour') AS "True";
</sql-statement>
-stdin-:<main>: Error: Type annotation

    -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
    	SELECT (time '00:00', interval '1 hour')
	^
        -stdin-:<main>:2:3: Error: At function: PgCall
        	  OVERLAPS (time '00:30', interval '1 hour') AS "True";
	  ^
            -stdin-:<main>:2:3: Error: Unable to find an overload for proc overlaps with given argument types: (time,interval,time,interval)
            	  OVERLAPS (time '00:30', interval '1 hour') AS "True";
	  ^
<sql-statement>
SELECT (time '00:00', interval '1 hour')
  OVERLAPS (time '01:30', interval '1 hour') AS "False";
</sql-statement>
-stdin-:<main>: Error: Type annotation

    -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
    	SELECT (time '00:00', interval '1 hour')
	^
        -stdin-:<main>:2:3: Error: At function: PgCall
        	  OVERLAPS (time '01:30', interval '1 hour') AS "False";
	  ^
            -stdin-:<main>:2:3: Error: Unable to find an overload for proc overlaps with given argument types: (time,interval,time,interval)
            	  OVERLAPS (time '01:30', interval '1 hour') AS "False";
	  ^
<sql-statement>
-- SQL99 seems to want this to be false (and we conform to the spec).
-- istm that this *should* return true, on the theory that time
-- intervals can wrap around the day boundary - thomas 2001-09-25
SELECT (time '00:00', interval '1 hour')
  OVERLAPS (time '01:30', interval '1 day') AS "False";
</sql-statement>
-stdin-:<main>: Error: Type annotation

    -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
    	-- SQL99 seems to want this to be false (and we conform to the spec).
	^
        -stdin-:<main>:5:3: Error: At function: PgCall
        	  OVERLAPS (time '01:30', interval '1 day') AS "False";
	  ^
            -stdin-:<main>:5:3: Error: Unable to find an overload for proc overlaps with given argument types: (time,interval,time,interval)
            	  OVERLAPS (time '01:30', interval '1 day') AS "False";
	  ^
<sql-statement>
CREATE TABLE TEMP_TIMESTAMP (f1 timestamp with time zone);
</sql-statement>
<sql-statement>
-- get some candidate input values
INSERT INTO TEMP_TIMESTAMP (f1)
  SELECT d1 FROM TIMESTAMP_TBL
  WHERE d1 BETWEEN '13-jun-1957' AND '1-jan-1997'
   OR d1 BETWEEN '1-jan-1999' AND '1-jan-2010';
</sql-statement>
<sql-statement>
SELECT f1 AS "timestamp"
  FROM TEMP_TIMESTAMP
  ORDER BY "timestamp";
</sql-statement>
<sql-statement>
SELECT d.f1 AS "timestamp", t.f1 AS "interval", d.f1 + t.f1 AS plus
  FROM TEMP_TIMESTAMP d, INTERVAL_TBL t
  ORDER BY plus, "timestamp", "interval";
</sql-statement>
<sql-statement>
SELECT d.f1 AS "timestamp", t.f1 AS "interval", d.f1 - t.f1 AS minus
  FROM TEMP_TIMESTAMP d, INTERVAL_TBL t
  WHERE isfinite(d.f1)
  ORDER BY minus, "timestamp", "interval";
</sql-statement>
<sql-statement>
SELECT d.f1 AS "timestamp",
   timestamp with time zone '1980-01-06 00:00 GMT' AS gpstime_zero,
   d.f1 - timestamp with time zone '1980-01-06 00:00 GMT' AS difference
  FROM TEMP_TIMESTAMP d
  ORDER BY difference;
</sql-statement>
<sql-statement>
SELECT d1.f1 AS timestamp1, d2.f1 AS timestamp2, d1.f1 - d2.f1 AS difference
  FROM TEMP_TIMESTAMP d1, TEMP_TIMESTAMP d2
  ORDER BY timestamp1, timestamp2, difference;
</sql-statement>
<sql-statement>
--
-- Conversions
--
SELECT f1 AS "timestamp", date(f1) AS date
  FROM TEMP_TIMESTAMP
  WHERE f1 <> timestamp 'now'
  ORDER BY date, "timestamp";
</sql-statement>
<sql-statement>
DROP TABLE TEMP_TIMESTAMP;
</sql-statement>
<sql-statement>
--
-- Comparisons between datetime types, especially overflow cases
---
SELECT '2202020-10-05'::date::timestamp;  -- fail
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	--
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  date out of range for timestamp

        	--
	^
<sql-statement>
SELECT '2202020-10-05'::date > '2020-10-05'::timestamp as t;
</sql-statement>
<sql-statement>
SELECT '2020-10-05'::timestamp > '2202020-10-05'::date as f;
</sql-statement>
<sql-statement>
SELECT '2202020-10-05'::date::timestamptz;  -- fail
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	SELECT '2202020-10-05'::date::timestamptz;  -- fail
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  date out of range for timestamp

        	SELECT '2202020-10-05'::date::timestamptz;  -- fail
	^
<sql-statement>
SELECT '2202020-10-05'::date > '2020-10-05'::timestamptz as t;
</sql-statement>
<sql-statement>
SELECT '2020-10-05'::timestamptz > '2202020-10-05'::date as f;
</sql-statement>
<sql-statement>
-- This conversion may work depending on timezone
SELECT '4714-11-24 BC'::date::timestamptz;
</sql-statement>
<sql-statement>
SET TimeZone = 'UTC-2';
</sql-statement>
<sql-statement>
SELECT '4714-11-24 BC'::date::timestamptz;  -- fail
</sql-statement>
<sql-statement>
SELECT '4714-11-24 BC'::date < '2020-10-05'::timestamptz as t;
</sql-statement>
<sql-statement>
SELECT '2020-10-05'::timestamptz >= '4714-11-24 BC'::date as t;
</sql-statement>
<sql-statement>
SELECT '4714-11-24 BC'::timestamp < '2020-10-05'::timestamptz as t;
</sql-statement>
<sql-statement>
SELECT '2020-10-05'::timestamptz >= '4714-11-24 BC'::timestamp as t;
</sql-statement>
<sql-statement>
RESET TimeZone;
</sql-statement>
<sql-statement>
--
-- Formats
--
SET DateStyle TO 'US,Postgres';
</sql-statement>
<sql-statement>
SHOW DateStyle;
</sql-statement>
-stdin-:<main>: Error: Parse Sql

    -stdin-:<main>:1:1: Error: unrecognized configuration parameter "datestyle"
    	SHOW DateStyle;
	^
<sql-statement>
SELECT d1 AS us_postgres FROM TIMESTAMP_TBL;
</sql-statement>
<sql-statement>
SET DateStyle TO 'US,ISO';
</sql-statement>
<sql-statement>
SELECT d1 AS us_iso FROM TIMESTAMP_TBL;
</sql-statement>
<sql-statement>
SET DateStyle TO 'US,SQL';
</sql-statement>
<sql-statement>
SHOW DateStyle;
</sql-statement>
-stdin-:<main>: Error: Parse Sql

    -stdin-:<main>:1:1: Error: unrecognized configuration parameter "datestyle"
    	SHOW DateStyle;
	^
<sql-statement>
SELECT d1 AS us_sql FROM TIMESTAMP_TBL;
</sql-statement>
<sql-statement>
SET DateStyle TO 'European,Postgres';
</sql-statement>
<sql-statement>
SHOW DateStyle;
</sql-statement>
-stdin-:<main>: Error: Parse Sql

    -stdin-:<main>:1:1: Error: unrecognized configuration parameter "datestyle"
    	SHOW DateStyle;
	^
<sql-statement>
INSERT INTO TIMESTAMP_TBL VALUES('13/06/1957');
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: YtFill!
    	INSERT INTO TIMESTAMP_TBL VALUES('13/06/1957');
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  date/time field value out of range: "13/06/1957"
HINT:  Perhaps you need a different "datestyle" setting.

        	INSERT INTO TIMESTAMP_TBL VALUES('13/06/1957');
	^
<sql-statement>
SELECT count(*) as one FROM TIMESTAMP_TBL WHERE d1 = 'Jun 13 1957';
</sql-statement>
<sql-statement>
SELECT d1 AS european_postgres FROM TIMESTAMP_TBL;
</sql-statement>
<sql-statement>
SET DateStyle TO 'European,ISO';
</sql-statement>
<sql-statement>
SHOW DateStyle;
</sql-statement>
-stdin-:<main>: Error: Parse Sql

    -stdin-:<main>:1:1: Error: unrecognized configuration parameter "datestyle"
    	SHOW DateStyle;
	^
<sql-statement>
SELECT d1 AS european_iso FROM TIMESTAMP_TBL;
</sql-statement>
<sql-statement>
SET DateStyle TO 'European,SQL';
</sql-statement>
<sql-statement>
SHOW DateStyle;
</sql-statement>
-stdin-:<main>: Error: Parse Sql

    -stdin-:<main>:1:1: Error: unrecognized configuration parameter "datestyle"
    	SHOW DateStyle;
	^
<sql-statement>
SELECT d1 AS european_sql FROM TIMESTAMP_TBL;
</sql-statement>
<sql-statement>
RESET DateStyle;
</sql-statement>
<sql-statement>
--
-- to_timestamp()
--
SELECT to_timestamp('0097/Feb/16 --> 08:14:30', 'YYYY/Mon/DD --> HH:MI:SS');
</sql-statement>
<sql-statement>
SELECT to_timestamp('97/2/16 8:14:30', 'FMYYYY/FMMM/FMDD FMHH:FMMI:FMSS');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2011$03!18 23_38_15', 'YYYY-MM-DD HH24:MI:SS');
</sql-statement>
<sql-statement>
SELECT to_timestamp('1985 January 12', 'YYYY FMMonth DD');
</sql-statement>
<sql-statement>
SELECT to_timestamp('1985 FMMonth 12', 'YYYY "FMMonth" DD');
</sql-statement>
<sql-statement>
SELECT to_timestamp('1985 \ 12', 'YYYY \\ DD');
</sql-statement>
<sql-statement>
SELECT to_timestamp('My birthday-> Year: 1976, Month: May, Day: 16',
                    '"My birthday-> Year:" YYYY, "Month:" FMMonth, "Day:" DD');
</sql-statement>
<sql-statement>
SELECT to_timestamp('1,582nd VIII 21', 'Y,YYYth FMRM DD');
</sql-statement>
<sql-statement>
SELECT to_timestamp('15 "text between quote marks" 98 54 45',
                    E'HH24 "\\"text between quote marks\\"" YY MI SS');
</sql-statement>
<sql-statement>
SELECT to_timestamp('05121445482000', 'MMDDHH24MISSYYYY');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2000January09Sunday', 'YYYYFMMonthDDFMDay');
</sql-statement>
<sql-statement>
SELECT to_timestamp('97/Feb/16', 'YYMonDD');
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	SELECT to_timestamp('97/Feb/16', 'YYMonDD');
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  invalid value "/Feb/16" for "Mon"
DETAIL:  The given value did not match any of the allowed values for this field.

        	SELECT to_timestamp('97/Feb/16', 'YYMonDD');
	^
<sql-statement>
SELECT to_timestamp('97/Feb/16', 'YY:Mon:DD');
</sql-statement>
<sql-statement>
SELECT to_timestamp('97/Feb/16', 'FXYY:Mon:DD');
</sql-statement>
<sql-statement>
SELECT to_timestamp('97/Feb/16', 'FXYY/Mon/DD');
</sql-statement>
<sql-statement>
SELECT to_timestamp('19971116', 'YYYYMMDD');
</sql-statement>
<sql-statement>
SELECT to_timestamp('20000-1116', 'YYYY-MMDD');
</sql-statement>
<sql-statement>
SELECT to_timestamp('1997 AD 11 16', 'YYYY BC MM DD');
</sql-statement>
<sql-statement>
SELECT to_timestamp('1997 BC 11 16', 'YYYY BC MM DD');
</sql-statement>
<sql-statement>
SELECT to_timestamp('1997 A.D. 11 16', 'YYYY B.C. MM DD');
</sql-statement>
<sql-statement>
SELECT to_timestamp('1997 B.C. 11 16', 'YYYY B.C. MM DD');
</sql-statement>
<sql-statement>
SELECT to_timestamp('9-1116', 'Y-MMDD');
</sql-statement>
<sql-statement>
SELECT to_timestamp('95-1116', 'YY-MMDD');
</sql-statement>
<sql-statement>
SELECT to_timestamp('995-1116', 'YYY-MMDD');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2005426', 'YYYYWWD');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2005300', 'YYYYDDD');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2005527', 'IYYYIWID');
</sql-statement>
<sql-statement>
SELECT to_timestamp('005527', 'IYYIWID');
</sql-statement>
<sql-statement>
SELECT to_timestamp('05527', 'IYIWID');
</sql-statement>
<sql-statement>
SELECT to_timestamp('5527', 'IIWID');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2005364', 'IYYYIDDD');
</sql-statement>
<sql-statement>
SELECT to_timestamp('20050302', 'YYYYMMDD');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2005 03 02', 'YYYYMMDD');
</sql-statement>
<sql-statement>
SELECT to_timestamp(' 2005 03 02', 'YYYYMMDD');
</sql-statement>
<sql-statement>
SELECT to_timestamp('  20050302', 'YYYYMMDD');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2011-12-18 11:38 AM', 'YYYY-MM-DD HH12:MI PM');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2011-12-18 11:38 PM', 'YYYY-MM-DD HH12:MI PM');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2011-12-18 11:38 A.M.', 'YYYY-MM-DD HH12:MI P.M.');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2011-12-18 11:38 P.M.', 'YYYY-MM-DD HH12:MI P.M.');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2011-12-18 11:38 +05',    'YYYY-MM-DD HH12:MI TZH');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2011-12-18 11:38 -05',    'YYYY-MM-DD HH12:MI TZH');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2011-12-18 11:38 +05:20', 'YYYY-MM-DD HH12:MI TZH:TZM');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2011-12-18 11:38 -05:20', 'YYYY-MM-DD HH12:MI TZH:TZM');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2011-12-18 11:38 20',     'YYYY-MM-DD HH12:MI TZM');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2011-12-18 11:38 PST', 'YYYY-MM-DD HH12:MI TZ');  -- NYI
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	SELECT to_timestamp('2011-12-18 11:38 PST', 'YYYY-MM-DD HH12:MI TZ');  -- NYI
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  formatting field "TZ" is only supported in to_char

        	SELECT to_timestamp('2011-12-18 11:38 PST', 'YYYY-MM-DD HH12:MI TZ');  -- NYI
	^
<sql-statement>
SELECT to_timestamp('2018-11-02 12:34:56.025', 'YYYY-MM-DD HH24:MI:SS.MS');
</sql-statement>
<sql-statement>
SELECT i, to_timestamp('2018-11-02 12:34:56', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
</sql-statement>
-stdin-:<main>: Error: Type annotation

    -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
    	SELECT i, to_timestamp('2018-11-02 12:34:56', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	^
        -stdin-:<main>:1:11: Error: At function: PgCall
        	SELECT i, to_timestamp('2018-11-02 12:34:56', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	          ^
            -stdin-:<main>:1:74: Error: At function: PgOp
            	SELECT i, to_timestamp('2018-11-02 12:34:56', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	                                                                         ^
                -stdin-:<main>:1:74: Error: Unable to find an overload for operator || with given argument type(s): (unknown,int4)
                	SELECT i, to_timestamp('2018-11-02 12:34:56', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	                                                                         ^
<sql-statement>
SELECT i, to_timestamp('2018-11-02 12:34:56.1', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
</sql-statement>
-stdin-:<main>: Error: Type annotation

    -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
    	SELECT i, to_timestamp('2018-11-02 12:34:56.1', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	^
        -stdin-:<main>:1:11: Error: At function: PgCall
        	SELECT i, to_timestamp('2018-11-02 12:34:56.1', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	          ^
            -stdin-:<main>:1:76: Error: At function: PgOp
            	SELECT i, to_timestamp('2018-11-02 12:34:56.1', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	                                                                           ^
                -stdin-:<main>:1:76: Error: Unable to find an overload for operator || with given argument type(s): (unknown,int4)
                	SELECT i, to_timestamp('2018-11-02 12:34:56.1', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	                                                                           ^
<sql-statement>
SELECT i, to_timestamp('2018-11-02 12:34:56.12', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
</sql-statement>
-stdin-:<main>: Error: Type annotation

    -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
    	SELECT i, to_timestamp('2018-11-02 12:34:56.12', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	^
        -stdin-:<main>:1:11: Error: At function: PgCall
        	SELECT i, to_timestamp('2018-11-02 12:34:56.12', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	          ^
            -stdin-:<main>:1:77: Error: At function: PgOp
            	SELECT i, to_timestamp('2018-11-02 12:34:56.12', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	                                                                            ^
                -stdin-:<main>:1:77: Error: Unable to find an overload for operator || with given argument type(s): (unknown,int4)
                	SELECT i, to_timestamp('2018-11-02 12:34:56.12', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	                                                                            ^
<sql-statement>
SELECT i, to_timestamp('2018-11-02 12:34:56.123', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
</sql-statement>
-stdin-:<main>: Error: Type annotation

    -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
    	SELECT i, to_timestamp('2018-11-02 12:34:56.123', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	^
        -stdin-:<main>:1:11: Error: At function: PgCall
        	SELECT i, to_timestamp('2018-11-02 12:34:56.123', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	          ^
            -stdin-:<main>:1:78: Error: At function: PgOp
            	SELECT i, to_timestamp('2018-11-02 12:34:56.123', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	                                                                             ^
                -stdin-:<main>:1:78: Error: Unable to find an overload for operator || with given argument type(s): (unknown,int4)
                	SELECT i, to_timestamp('2018-11-02 12:34:56.123', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	                                                                             ^
<sql-statement>
SELECT i, to_timestamp('2018-11-02 12:34:56.1234', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
</sql-statement>
-stdin-:<main>: Error: Type annotation

    -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
    	SELECT i, to_timestamp('2018-11-02 12:34:56.1234', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	^
        -stdin-:<main>:1:11: Error: At function: PgCall
        	SELECT i, to_timestamp('2018-11-02 12:34:56.1234', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	          ^
            -stdin-:<main>:1:79: Error: At function: PgOp
            	SELECT i, to_timestamp('2018-11-02 12:34:56.1234', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	                                                                              ^
                -stdin-:<main>:1:79: Error: Unable to find an overload for operator || with given argument type(s): (unknown,int4)
                	SELECT i, to_timestamp('2018-11-02 12:34:56.1234', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	                                                                              ^
<sql-statement>
SELECT i, to_timestamp('2018-11-02 12:34:56.12345', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
</sql-statement>
-stdin-:<main>: Error: Type annotation

    -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
    	SELECT i, to_timestamp('2018-11-02 12:34:56.12345', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	^
        -stdin-:<main>:1:11: Error: At function: PgCall
        	SELECT i, to_timestamp('2018-11-02 12:34:56.12345', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	          ^
            -stdin-:<main>:1:80: Error: At function: PgOp
            	SELECT i, to_timestamp('2018-11-02 12:34:56.12345', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	                                                                               ^
                -stdin-:<main>:1:80: Error: Unable to find an overload for operator || with given argument type(s): (unknown,int4)
                	SELECT i, to_timestamp('2018-11-02 12:34:56.12345', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	                                                                               ^
<sql-statement>
SELECT i, to_timestamp('2018-11-02 12:34:56.123456', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
</sql-statement>
-stdin-:<main>: Error: Type annotation

    -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
    	SELECT i, to_timestamp('2018-11-02 12:34:56.123456', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	^
        -stdin-:<main>:1:11: Error: At function: PgCall
        	SELECT i, to_timestamp('2018-11-02 12:34:56.123456', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	          ^
            -stdin-:<main>:1:81: Error: At function: PgOp
            	SELECT i, to_timestamp('2018-11-02 12:34:56.123456', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	                                                                                ^
                -stdin-:<main>:1:81: Error: Unable to find an overload for operator || with given argument type(s): (unknown,int4)
                	SELECT i, to_timestamp('2018-11-02 12:34:56.123456', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	                                                                                ^
<sql-statement>
SELECT i, to_timestamp('2018-11-02 12:34:56.123456789', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
</sql-statement>
-stdin-:<main>: Error: Type annotation

    -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
    	SELECT i, to_timestamp('2018-11-02 12:34:56.123456789', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	^
        -stdin-:<main>:1:11: Error: At function: PgCall
        	SELECT i, to_timestamp('2018-11-02 12:34:56.123456789', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	          ^
            -stdin-:<main>:1:84: Error: At function: PgOp
            	SELECT i, to_timestamp('2018-11-02 12:34:56.123456789', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	                                                                                   ^
                -stdin-:<main>:1:84: Error: Unable to find an overload for operator || with given argument type(s): (unknown,int4)
                	SELECT i, to_timestamp('2018-11-02 12:34:56.123456789', 'YYYY-MM-DD HH24:MI:SS.FF' || i) FROM generate_series(1, 6) i;
	                                                                                   ^
<sql-statement>
SELECT to_date('1 4 1902', 'Q MM YYYY');  -- Q is ignored
</sql-statement>
<sql-statement>
SELECT to_date('3 4 21 01', 'W MM CC YY');
</sql-statement>
<sql-statement>
SELECT to_date('2458872', 'J');
</sql-statement>
<sql-statement>
--
-- Check handling of BC dates
--
SELECT to_date('44-02-01 BC','YYYY-MM-DD BC');
</sql-statement>
<sql-statement>
SELECT to_date('-44-02-01','YYYY-MM-DD');
</sql-statement>
<sql-statement>
SELECT to_date('-44-02-01 BC','YYYY-MM-DD BC');
</sql-statement>
<sql-statement>
SELECT to_timestamp('44-02-01 11:12:13 BC','YYYY-MM-DD HH24:MI:SS BC');
</sql-statement>
<sql-statement>
SELECT to_timestamp('-44-02-01 11:12:13','YYYY-MM-DD HH24:MI:SS');
</sql-statement>
<sql-statement>
SELECT to_timestamp('-44-02-01 11:12:13 BC','YYYY-MM-DD HH24:MI:SS BC');
</sql-statement>
<sql-statement>
--
-- Check handling of multiple spaces in format and/or input
--
SELECT to_timestamp('2011-12-18 23:38:15', 'YYYY-MM-DD  HH24:MI:SS');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2011-12-18  23:38:15', 'YYYY-MM-DD  HH24:MI:SS');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2011-12-18   23:38:15', 'YYYY-MM-DD  HH24:MI:SS');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2011-12-18  23:38:15', 'YYYY-MM-DD HH24:MI:SS');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2011-12-18  23:38:15', 'YYYY-MM-DD  HH24:MI:SS');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2011-12-18  23:38:15', 'YYYY-MM-DD   HH24:MI:SS');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2000+   JUN', 'YYYY/MON');
</sql-statement>
<sql-statement>
SELECT to_timestamp('  2000 +JUN', 'YYYY/MON');
</sql-statement>
<sql-statement>
SELECT to_timestamp(' 2000 +JUN', 'YYYY//MON');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2000  +JUN', 'YYYY//MON');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2000 + JUN', 'YYYY MON');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2000 ++ JUN', 'YYYY  MON');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2000 + + JUN', 'YYYY  MON');
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	SELECT to_timestamp('2000 + + JUN', 'YYYY  MON');
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  invalid value "+" for "MON"
DETAIL:  The given value did not match any of the allowed values for this field.

        	SELECT to_timestamp('2000 + + JUN', 'YYYY  MON');
	^
<sql-statement>
SELECT to_timestamp('2000 + + JUN', 'YYYY   MON');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2000 -10', 'YYYY TZH');
</sql-statement>
<sql-statement>
SELECT to_timestamp('2000 -10', 'YYYY  TZH');
</sql-statement>
<sql-statement>
SELECT to_date('2011 12  18', 'YYYY MM DD');
</sql-statement>
<sql-statement>
SELECT to_date('2011 12  18', 'YYYY MM  DD');
</sql-statement>
<sql-statement>
SELECT to_date('2011 12  18', 'YYYY MM   DD');
</sql-statement>
<sql-statement>
SELECT to_date('2011 12 18', 'YYYY  MM DD');
</sql-statement>
<sql-statement>
SELECT to_date('2011  12 18', 'YYYY  MM DD');
</sql-statement>
<sql-statement>
SELECT to_date('2011   12 18', 'YYYY  MM DD');
</sql-statement>
<sql-statement>
SELECT to_date('2011 12 18', 'YYYYxMMxDD');
</sql-statement>
<sql-statement>
SELECT to_date('2011x 12x 18', 'YYYYxMMxDD');
</sql-statement>
<sql-statement>
SELECT to_date('2011 x12 x18', 'YYYYxMMxDD');
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	SELECT to_date('2011 x12 x18', 'YYYYxMMxDD');
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  invalid value "x1" for "MM"
DETAIL:  Value must be an integer.

        	SELECT to_date('2011 x12 x18', 'YYYYxMMxDD');
	^
<sql-statement>
--
-- Check errors for some incorrect usages of to_timestamp() and to_date()
--
-- Mixture of date conventions (ISO week and Gregorian):
SELECT to_timestamp('2005527', 'YYYYIWID');
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	--
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  invalid combination of date conventions
HINT:  Do not mix Gregorian and ISO week date conventions in a formatting template.

        	--
	^
<sql-statement>
-- Insufficient characters in the source string:
SELECT to_timestamp('19971', 'YYYYMMDD');
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	-- Insufficient characters in the source string:
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  source string too short for "MM" formatting field
DETAIL:  Field requires 2 characters, but only 1 remain.
HINT:  If your source string is not fixed-width, try using the "FM" modifier.

        	-- Insufficient characters in the source string:
	^
<sql-statement>
-- Insufficient digit characters for a single node:
SELECT to_timestamp('19971)24', 'YYYYMMDD');
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	-- Insufficient digit characters for a single node:
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  invalid value "1)" for "MM"
DETAIL:  Field requires 2 characters, but only 1 could be parsed.
HINT:  If your source string is not fixed-width, try using the "FM" modifier.

        	-- Insufficient digit characters for a single node:
	^
<sql-statement>
-- We don't accept full-length day or month names if short form is specified:
SELECT to_timestamp('Friday 1-January-1999', 'DY DD MON YYYY');
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	-- We don't accept full-length day or month names if short form is specified:
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  invalid value "da" for "DD"
DETAIL:  Value must be an integer.

        	-- We don't accept full-length day or month names if short form is specified:
	^
<sql-statement>
SELECT to_timestamp('Fri 1-January-1999', 'DY DD MON YYYY');
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	SELECT to_timestamp('Fri 1-January-1999', 'DY DD MON YYYY');
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  invalid value "uary" for "YYYY"
DETAIL:  Value must be an integer.

        	SELECT to_timestamp('Fri 1-January-1999', 'DY DD MON YYYY');
	^
<sql-statement>
SELECT to_timestamp('Fri 1-Jan-1999', 'DY DD MON YYYY');  -- ok
</sql-statement>
<sql-statement>
-- Value clobbering:
SELECT to_timestamp('1997-11-Jan-16', 'YYYY-MM-Mon-DD');
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	-- Value clobbering:
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  conflicting values for "Mon" field in formatting string
DETAIL:  This value contradicts a previous setting for the same field type.

        	-- Value clobbering:
	^
<sql-statement>
-- Non-numeric input:
SELECT to_timestamp('199711xy', 'YYYYMMDD');
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	-- Non-numeric input:
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  invalid value "xy" for "DD"
DETAIL:  Value must be an integer.

        	-- Non-numeric input:
	^
<sql-statement>
-- Input that doesn't fit in an int:
SELECT to_timestamp('10000000000', 'FMYYYY');
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	-- Input that doesn't fit in an int:
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  value for "YYYY" in source string is out of range
DETAIL:  Value must be in the range -2147483648 to 2147483647.

        	-- Input that doesn't fit in an int:
	^
<sql-statement>
-- Out-of-range and not-quite-out-of-range fields:
SELECT to_timestamp('2016-06-13 25:00:00', 'YYYY-MM-DD HH24:MI:SS');
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	-- Out-of-range and not-quite-out-of-range fields:
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  date/time field value out of range: "2016-06-13 25:00:00"

        	-- Out-of-range and not-quite-out-of-range fields:
	^
<sql-statement>
SELECT to_timestamp('2016-06-13 15:60:00', 'YYYY-MM-DD HH24:MI:SS');
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	SELECT to_timestamp('2016-06-13 15:60:00', 'YYYY-MM-DD HH24:MI:SS');
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  date/time field value out of range: "2016-06-13 15:60:00"

        	SELECT to_timestamp('2016-06-13 15:60:00', 'YYYY-MM-DD HH24:MI:SS');
	^
<sql-statement>
SELECT to_timestamp('2016-06-13 15:50:60', 'YYYY-MM-DD HH24:MI:SS');
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	SELECT to_timestamp('2016-06-13 15:50:60', 'YYYY-MM-DD HH24:MI:SS');
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  date/time field value out of range: "2016-06-13 15:50:60"

        	SELECT to_timestamp('2016-06-13 15:50:60', 'YYYY-MM-DD HH24:MI:SS');
	^
<sql-statement>
SELECT to_timestamp('2016-06-13 15:50:55', 'YYYY-MM-DD HH24:MI:SS');  -- ok
</sql-statement>
<sql-statement>
SELECT to_timestamp('2016-06-13 15:50:55', 'YYYY-MM-DD HH:MI:SS');
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	SELECT to_timestamp('2016-06-13 15:50:55', 'YYYY-MM-DD HH:MI:SS');
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  hour "15" is invalid for the 12-hour clock
HINT:  Use the 24-hour clock, or give an hour between 1 and 12.

        	SELECT to_timestamp('2016-06-13 15:50:55', 'YYYY-MM-DD HH:MI:SS');
	^
<sql-statement>
SELECT to_timestamp('2016-13-01 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	SELECT to_timestamp('2016-13-01 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  date/time field value out of range: "2016-13-01 15:50:55"

        	SELECT to_timestamp('2016-13-01 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
	^
<sql-statement>
SELECT to_timestamp('2016-02-30 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	SELECT to_timestamp('2016-02-30 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  date/time field value out of range: "2016-02-30 15:50:55"

        	SELECT to_timestamp('2016-02-30 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
	^
<sql-statement>
SELECT to_timestamp('2016-02-29 15:50:55', 'YYYY-MM-DD HH24:MI:SS');  -- ok
</sql-statement>
<sql-statement>
SELECT to_timestamp('2015-02-29 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	SELECT to_timestamp('2015-02-29 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  date/time field value out of range: "2015-02-29 15:50:55"

        	SELECT to_timestamp('2015-02-29 15:50:55', 'YYYY-MM-DD HH24:MI:SS');
	^
<sql-statement>
SELECT to_timestamp('2015-02-11 86000', 'YYYY-MM-DD SSSS');  -- ok
</sql-statement>
<sql-statement>
SELECT to_timestamp('2015-02-11 86400', 'YYYY-MM-DD SSSS');
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	SELECT to_timestamp('2015-02-11 86400', 'YYYY-MM-DD SSSS');
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  date/time field value out of range: "2015-02-11 86400"

        	SELECT to_timestamp('2015-02-11 86400', 'YYYY-MM-DD SSSS');
	^
<sql-statement>
SELECT to_timestamp('2015-02-11 86000', 'YYYY-MM-DD SSSSS');  -- ok
</sql-statement>
<sql-statement>
SELECT to_timestamp('2015-02-11 86400', 'YYYY-MM-DD SSSSS');
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	SELECT to_timestamp('2015-02-11 86400', 'YYYY-MM-DD SSSSS');
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  date/time field value out of range: "2015-02-11 86400"

        	SELECT to_timestamp('2015-02-11 86400', 'YYYY-MM-DD SSSSS');
	^
<sql-statement>
SELECT to_date('2016-13-10', 'YYYY-MM-DD');
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	SELECT to_date('2016-13-10', 'YYYY-MM-DD');
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  date/time field value out of range: "2016-13-10"

        	SELECT to_date('2016-13-10', 'YYYY-MM-DD');
	^
<sql-statement>
SELECT to_date('2016-02-30', 'YYYY-MM-DD');
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	SELECT to_date('2016-02-30', 'YYYY-MM-DD');
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  date/time field value out of range: "2016-02-30"

        	SELECT to_date('2016-02-30', 'YYYY-MM-DD');
	^
<sql-statement>
SELECT to_date('2016-02-29', 'YYYY-MM-DD');  -- ok
</sql-statement>
<sql-statement>
SELECT to_date('2015-02-29', 'YYYY-MM-DD');
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	SELECT to_date('2015-02-29', 'YYYY-MM-DD');
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  date/time field value out of range: "2015-02-29"

        	SELECT to_date('2015-02-29', 'YYYY-MM-DD');
	^
<sql-statement>
SELECT to_date('2015 365', 'YYYY DDD');  -- ok
</sql-statement>
<sql-statement>
SELECT to_date('2015 366', 'YYYY DDD');
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	SELECT to_date('2015 366', 'YYYY DDD');
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  date/time field value out of range: "2015 366"

        	SELECT to_date('2015 366', 'YYYY DDD');
	^
<sql-statement>
SELECT to_date('2016 365', 'YYYY DDD');  -- ok
</sql-statement>
<sql-statement>
SELECT to_date('2016 366', 'YYYY DDD');  -- ok
</sql-statement>
<sql-statement>
SELECT to_date('2016 367', 'YYYY DDD');
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	SELECT to_date('2016 367', 'YYYY DDD');
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  date/time field value out of range: "2016 367"

        	SELECT to_date('2016 367', 'YYYY DDD');
	^
<sql-statement>
SELECT to_date('0000-02-01','YYYY-MM-DD');  -- allowed, though it shouldn't be
</sql-statement>
<sql-statement>
--
-- Check behavior with SQL-style fixed-GMT-offset time zone (cf bug #8572)
--
SET TIME ZONE 'America/New_York';
</sql-statement>
<sql-statement>
SET TIME ZONE '-1.5';
</sql-statement>
<sql-statement>
SHOW TIME ZONE;
</sql-statement>
-stdin-:<main>: Error: Parse Sql

    -stdin-:<main>:1:1: Error: unrecognized configuration parameter "timezone"
    	SHOW TIME ZONE;
	^
<sql-statement>
SELECT '2012-12-12 12:00'::timestamptz;
</sql-statement>
<sql-statement>
SELECT '2012-12-12 12:00 America/New_York'::timestamptz;
</sql-statement>
-stdin-:<main>: Fatal: Execution

    -stdin-:<main>:1:1: Fatal: Execution of node: Result
    	SELECT '2012-12-12 12:00 America/New_York'::timestamptz;
	^
        -stdin-:<main>:1:1: Fatal: ERROR:  time zone "america/new_york" not recognized

        	SELECT '2012-12-12 12:00 America/New_York'::timestamptz;
	^
<sql-statement>
SELECT to_char('2012-12-12 12:00'::timestamptz, 'YYYY-MM-DD HH:MI:SS TZ');
</sql-statement>
<sql-statement>
SELECT to_char('2012-12-12 12:00'::timestamptz, 'YYYY-MM-DD SSSS');
</sql-statement>
<sql-statement>
SELECT to_char('2012-12-12 12:00'::timestamptz, 'YYYY-MM-DD SSSSS');
</sql-statement>
<sql-statement>
RESET TIME ZONE;
</sql-statement>