pg_query 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/pg_query/deparse/keywords.rb +154 -755
- data/lib/pg_query/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e8912d6c8962c7e999e1a14d4258f0553cdf6e538e20e6374cb4b362118ec84
|
4
|
+
data.tar.gz: e27779fc7d4e15c76d8a38195541240c2b48508d2d07fe17eef715ac00e91a06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8eaa86d4571c15b3ea496bf5f85a4e2b1c69f5b1c2f2ad179862d020ca00d6fac160f0a1296707d0bee802f5b0e7cf29b466deb4c04927ec6e6987e31d2347f7
|
7
|
+
data.tar.gz: d766dc39d5b3ec3ee9fe1809ece77ca8a83c78290e4d72893e86cff37e4d47eac18b2dc18437807e2f5b4a4c50ccfe518831a9dae9e7bdd7cfd778eed86c9415
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.2.0 2019-11-10
|
4
|
+
|
5
|
+
* Reduce escaped keywords to Postgres-specific keywords, and ignore unreserved keywords
|
6
|
+
* This matches the behaviour of Postgres' quote_identifier function, and avoids problems
|
7
|
+
when doing text comparisons with output involving that function
|
8
|
+
* Note that this will lead to different output than in earlier pg_query versions,
|
9
|
+
in some cases
|
10
|
+
|
3
11
|
## 1.1.1 2019-11-10
|
4
12
|
|
5
13
|
* Deparsing improvements by [@emin100](https://github.com/emin100)
|
@@ -1,760 +1,159 @@
|
|
1
1
|
class PgQuery
|
2
2
|
module Deparse # rubocop:disable Metrics/ModuleLength
|
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
|
-
'DATA',
|
158
|
-
'DATABASE',
|
159
|
-
'DATALINK',
|
160
|
-
'DATE',
|
161
|
-
'DATETIME_INTERVAL_CODE',
|
162
|
-
'DATETIME_INTERVAL_PRECISION',
|
163
|
-
'DAY',
|
164
|
-
'DB',
|
165
|
-
'DEALLOCATE',
|
166
|
-
'DEC',
|
167
|
-
'DECIMAL',
|
168
|
-
'DECLARE',
|
169
|
-
'DEFAULT',
|
170
|
-
'DEFAULTS',
|
171
|
-
'DEFERRABLE',
|
172
|
-
'DEFERRED',
|
173
|
-
'DEFINED',
|
174
|
-
'DEFINER',
|
175
|
-
'DEGREE',
|
176
|
-
'DELETE',
|
177
|
-
'DELIMITER',
|
178
|
-
'DELIMITERS',
|
179
|
-
'DENSE_RANK',
|
180
|
-
'DEPENDS',
|
181
|
-
'DEPTH',
|
182
|
-
'DEREF',
|
183
|
-
'DERIVED',
|
184
|
-
'DESC',
|
185
|
-
'DESCRIBE',
|
186
|
-
'DESCRIPTOR',
|
187
|
-
'DETERMINISTIC',
|
188
|
-
'DIAGNOSTICS',
|
189
|
-
'DICTIONARY',
|
190
|
-
'DISABLE',
|
191
|
-
'DISCARD',
|
192
|
-
'DISCONNECT',
|
193
|
-
'DISPATCH',
|
194
|
-
'DISTINCT',
|
195
|
-
'DLNEWCOPY',
|
196
|
-
'DLPREVIOUSCOPY',
|
197
|
-
'DLURLCOMPLETE',
|
198
|
-
'DLURLCOMPLETEONLY',
|
199
|
-
'DLURLCOMPLETEWRITE',
|
200
|
-
'DLURLPATH',
|
201
|
-
'DLURLPATHONLY',
|
202
|
-
'DLURLPATHWRITE',
|
203
|
-
'DLURLSCHEME',
|
204
|
-
'DLURLSERVER',
|
205
|
-
'DLVALUE',
|
206
|
-
'DO',
|
207
|
-
'DOCUMENT',
|
208
|
-
'DOMAIN',
|
209
|
-
'DOUBLE',
|
210
|
-
'DROP',
|
211
|
-
'DYNAMIC',
|
212
|
-
'DYNAMIC_FUNCTION',
|
213
|
-
'DYNAMIC_FUNCTION_CODE',
|
214
|
-
'EACH',
|
215
|
-
'ELEMENT',
|
216
|
-
'ELSE',
|
217
|
-
'EMPTY',
|
218
|
-
'ENABLE',
|
219
|
-
'ENCODING',
|
220
|
-
'ENCRYPTED',
|
221
|
-
'END',
|
222
|
-
'END-EXEC',
|
223
|
-
'END_FRAME',
|
224
|
-
'END_PARTITION',
|
225
|
-
'ENFORCED',
|
226
|
-
'ENUM',
|
227
|
-
'EQUALS',
|
228
|
-
'ESCAPE',
|
229
|
-
'EVENT',
|
230
|
-
'EVERY',
|
231
|
-
'EXCEPT',
|
232
|
-
'EXCEPTION',
|
233
|
-
'EXCLUDE',
|
234
|
-
'EXCLUDING',
|
235
|
-
'EXCLUSIVE',
|
236
|
-
'EXEC',
|
237
|
-
'EXECUTE',
|
238
|
-
'EXISTS',
|
239
|
-
'EXP',
|
240
|
-
'EXPLAIN',
|
241
|
-
'EXPRESSION',
|
242
|
-
'EXTENSION',
|
243
|
-
'EXTERNAL',
|
244
|
-
'EXTRACT',
|
245
|
-
'FALSE',
|
246
|
-
'FAMILY',
|
247
|
-
'FETCH',
|
248
|
-
'FILE',
|
249
|
-
'FILTER',
|
250
|
-
'FINAL',
|
251
|
-
'FIRST',
|
252
|
-
'FIRST_VALUE',
|
253
|
-
'FLAG',
|
254
|
-
'FLOAT',
|
255
|
-
'FLOOR',
|
256
|
-
'FOLLOWING',
|
257
|
-
'FOR',
|
258
|
-
'FORCE',
|
259
|
-
'FOREIGN',
|
260
|
-
'FORTRAN',
|
261
|
-
'FORWARD',
|
262
|
-
'FOUND',
|
263
|
-
'FRAME_ROW',
|
264
|
-
'FREE',
|
265
|
-
'FREEZE',
|
266
|
-
'FROM',
|
267
|
-
'FS',
|
268
|
-
'FULL',
|
269
|
-
'FUNCTION',
|
270
|
-
'FUNCTIONS',
|
271
|
-
'FUSION',
|
272
|
-
'G',
|
273
|
-
'GENERAL',
|
274
|
-
'GENERATED',
|
275
|
-
'GET',
|
276
|
-
'GLOBAL',
|
277
|
-
'GO',
|
278
|
-
'GOTO',
|
279
|
-
'GRANT',
|
280
|
-
'GRANTED',
|
281
|
-
'GREATEST',
|
282
|
-
'GROUP',
|
283
|
-
'GROUPING',
|
284
|
-
'GROUPS',
|
285
|
-
'HANDLER',
|
286
|
-
'HAVING',
|
287
|
-
'HEADER',
|
288
|
-
'HEX',
|
289
|
-
'HIERARCHY',
|
290
|
-
'HOLD',
|
291
|
-
'HOUR',
|
292
|
-
'ID',
|
293
|
-
'IDENTITY',
|
294
|
-
'IF',
|
295
|
-
'IGNORE',
|
296
|
-
'ILIKE',
|
297
|
-
'IMMEDIATE',
|
298
|
-
'IMMEDIATELY',
|
299
|
-
'IMMUTABLE',
|
300
|
-
'IMPLEMENTATION',
|
301
|
-
'IMPLICIT',
|
302
|
-
'IMPORT',
|
303
|
-
'IN',
|
304
|
-
'INCLUDING',
|
305
|
-
'INCREMENT',
|
306
|
-
'INDENT',
|
307
|
-
'INDEX',
|
308
|
-
'INDEXES',
|
309
|
-
'INDICATOR',
|
310
|
-
'INHERIT',
|
311
|
-
'INHERITS',
|
312
|
-
'INITIALLY',
|
313
|
-
'INLINE',
|
314
|
-
'INNER',
|
315
|
-
'INOUT',
|
316
|
-
'INPUT',
|
317
|
-
'INSENSITIVE',
|
318
|
-
'INSERT',
|
319
|
-
'INSTANCE',
|
320
|
-
'INSTANTIABLE',
|
321
|
-
'INSTEAD',
|
322
|
-
'INT',
|
323
|
-
'INTEGER',
|
324
|
-
'INTEGRITY',
|
325
|
-
'INTERSECT',
|
326
|
-
'INTERSECTION',
|
327
|
-
'INTERVAL',
|
328
|
-
'INTO',
|
329
|
-
'INVOKER',
|
330
|
-
'IS',
|
331
|
-
'ISNULL',
|
332
|
-
'ISOLATION',
|
333
|
-
'JOIN',
|
334
|
-
'K',
|
335
|
-
'KEY',
|
336
|
-
'KEY_MEMBER',
|
337
|
-
'KEY_TYPE',
|
338
|
-
'LABEL',
|
339
|
-
'LAG',
|
340
|
-
'LANGUAGE',
|
341
|
-
'LARGE',
|
342
|
-
'LAST',
|
343
|
-
'LAST_VALUE',
|
344
|
-
'LATERAL',
|
345
|
-
'LEAD',
|
346
|
-
'LEADING',
|
347
|
-
'LEAKPROOF',
|
348
|
-
'LEAST',
|
349
|
-
'LEFT',
|
350
|
-
'LENGTH',
|
351
|
-
'LEVEL',
|
352
|
-
'LIBRARY',
|
353
|
-
'LIKE',
|
354
|
-
'LIKE_REGEX',
|
355
|
-
'LIMIT',
|
356
|
-
'LINK',
|
357
|
-
'LISTEN',
|
358
|
-
'LN',
|
359
|
-
'LOAD',
|
360
|
-
'LOCAL',
|
361
|
-
'LOCALTIME',
|
362
|
-
'LOCALTIMESTAMP',
|
363
|
-
'LOCATION',
|
364
|
-
'LOCATOR',
|
365
|
-
'LOCK',
|
366
|
-
'LOCKED',
|
367
|
-
'LOGGED',
|
368
|
-
'LOWER',
|
369
|
-
'M',
|
370
|
-
'MAP',
|
371
|
-
'MAPPING',
|
372
|
-
'MATCH',
|
373
|
-
'MATCHED',
|
374
|
-
'MATERIALIZED',
|
375
|
-
'MAX',
|
376
|
-
'MAXVALUE',
|
377
|
-
'MAX_CARDINALITY',
|
378
|
-
'MEMBER',
|
379
|
-
'MERGE',
|
380
|
-
'MESSAGE_LENGTH',
|
381
|
-
'MESSAGE_OCTET_LENGTH',
|
382
|
-
'MESSAGE_TEXT',
|
383
|
-
'METHOD',
|
384
|
-
'MIN',
|
385
|
-
'MINUTE',
|
386
|
-
'MINVALUE',
|
387
|
-
'MOD',
|
388
|
-
'MODE',
|
389
|
-
'MODIFIES',
|
390
|
-
'MODULE',
|
391
|
-
'MONTH',
|
392
|
-
'MORE',
|
393
|
-
'MOVE',
|
394
|
-
'MULTISET',
|
395
|
-
'MUMPS',
|
396
|
-
'NAME',
|
397
|
-
'NAMES',
|
398
|
-
'NAMESPACE',
|
399
|
-
'NATIONAL',
|
400
|
-
'NATURAL',
|
401
|
-
'NCHAR',
|
402
|
-
'NCLOB',
|
403
|
-
'NESTING',
|
404
|
-
'NEW',
|
405
|
-
'NEXT',
|
406
|
-
'NFC',
|
407
|
-
'NFD',
|
408
|
-
'NFKC',
|
409
|
-
'NFKD',
|
410
|
-
'NIL',
|
411
|
-
'NO',
|
412
|
-
'NONE',
|
413
|
-
'NORMALIZE',
|
414
|
-
'NORMALIZED',
|
415
|
-
'NOT',
|
416
|
-
'NOTHING',
|
417
|
-
'NOTIFY',
|
418
|
-
'NOTNULL',
|
419
|
-
'NOWAIT',
|
420
|
-
'NTH_VALUE',
|
421
|
-
'NTILE',
|
422
|
-
'NULL',
|
423
|
-
'NULLABLE',
|
424
|
-
'NULLIF',
|
425
|
-
'NULLS',
|
426
|
-
'NUMBER',
|
427
|
-
'NUMERIC',
|
428
|
-
'OBJECT',
|
429
|
-
'OCCURRENCES_REGEX',
|
430
|
-
'OCTETS',
|
431
|
-
'OCTET_LENGTH',
|
432
|
-
'OF',
|
433
|
-
'OFF',
|
434
|
-
'OFFSET',
|
435
|
-
'OIDS',
|
436
|
-
'OLD',
|
437
|
-
'ON',
|
438
|
-
'ONLY',
|
439
|
-
'OPEN',
|
440
|
-
'OPERATOR',
|
441
|
-
'OPTION',
|
442
|
-
'OPTIONS',
|
443
|
-
'OR',
|
444
|
-
'ORDER',
|
445
|
-
'ORDERING',
|
446
|
-
'ORDINALITY',
|
447
|
-
'OTHERS',
|
448
|
-
'OUT',
|
449
|
-
'OUTER',
|
450
|
-
'OUTPUT',
|
451
|
-
'OVER',
|
452
|
-
'OVERLAPS',
|
453
|
-
'OVERLAY',
|
454
|
-
'OVERRIDING',
|
455
|
-
'OWNED',
|
456
|
-
'OWNER',
|
457
|
-
'P',
|
458
|
-
'PAD',
|
459
|
-
'PARALLEL',
|
460
|
-
'PARAMETER',
|
461
|
-
'PARAMETER_MODE',
|
462
|
-
'PARAMETER_NAME',
|
463
|
-
'PARAMETER_ORDINAL_POSITION',
|
464
|
-
'PARAMETER_SPECIFIC_CATALOG',
|
465
|
-
'PARAMETER_SPECIFIC_NAME',
|
466
|
-
'PARAMETER_SPECIFIC_SCHEMA',
|
467
|
-
'PARSER',
|
468
|
-
'PARTIAL',
|
469
|
-
'PARTITION',
|
470
|
-
'PASCAL',
|
471
|
-
'PASSING',
|
472
|
-
'PASSTHROUGH',
|
473
|
-
'PASSWORD',
|
474
|
-
'PATH',
|
475
|
-
'PERCENT',
|
476
|
-
'PERCENTILE_CONT',
|
477
|
-
'PERCENTILE_DISC',
|
478
|
-
'PERCENT_RANK',
|
479
|
-
'PERIOD',
|
480
|
-
'PERMISSION',
|
481
|
-
'PLACING',
|
482
|
-
'PLANS',
|
483
|
-
'PLI',
|
484
|
-
'POLICY',
|
485
|
-
'PORTION',
|
486
|
-
'POSITION',
|
487
|
-
'POSITION_REGEX',
|
488
|
-
'POWER',
|
489
|
-
'PRECEDES',
|
490
|
-
'PRECEDING',
|
491
|
-
'PRECISION',
|
492
|
-
'PREPARE',
|
493
|
-
'PREPARED',
|
494
|
-
'PRESERVE',
|
495
|
-
'PRIMARY',
|
496
|
-
'PRIOR',
|
497
|
-
'PRIVILEGES',
|
498
|
-
'PROCEDURAL',
|
499
|
-
'PROCEDURE',
|
500
|
-
'PROGRAM',
|
501
|
-
'PUBLIC',
|
502
|
-
'QUOTE',
|
503
|
-
'RANGE',
|
504
|
-
'RANK',
|
505
|
-
'READ',
|
506
|
-
'READS',
|
507
|
-
'REAL',
|
508
|
-
'REASSIGN',
|
509
|
-
'RECHECK',
|
510
|
-
'RECOVERY',
|
511
|
-
'RECURSIVE',
|
512
|
-
'REF',
|
513
|
-
'REFERENCES',
|
514
|
-
'REFERENCING',
|
515
|
-
'REFRESH',
|
516
|
-
'REGR_AVGX',
|
517
|
-
'REGR_AVGY',
|
518
|
-
'REGR_COUNT',
|
519
|
-
'REGR_INTERCEPT',
|
520
|
-
'REGR_R2',
|
521
|
-
'REGR_SLOPE',
|
522
|
-
'REGR_SXX',
|
523
|
-
'REGR_SXY',
|
524
|
-
'REGR_SYY',
|
525
|
-
'REINDEX',
|
526
|
-
'RELATIVE',
|
527
|
-
'RELEASE',
|
528
|
-
'RENAME',
|
529
|
-
'REPEATABLE',
|
530
|
-
'REPLACE',
|
531
|
-
'REPLICA',
|
532
|
-
'REQUIRING',
|
533
|
-
'RESET',
|
534
|
-
'RESPECT',
|
535
|
-
'RESTART',
|
536
|
-
'RESTORE',
|
537
|
-
'RESTRICT',
|
538
|
-
'RESULT',
|
539
|
-
'RETURN',
|
540
|
-
'RETURNED_CARDINALITY',
|
541
|
-
'RETURNED_LENGTH',
|
542
|
-
'RETURNED_OCTET_LENGTH',
|
543
|
-
'RETURNED_SQLSTATE',
|
544
|
-
'RETURNING',
|
545
|
-
'RETURNS',
|
546
|
-
'REVOKE',
|
547
|
-
'RIGHT',
|
548
|
-
'ROLE',
|
549
|
-
'ROLLBACK',
|
550
|
-
'ROLLUP',
|
551
|
-
'ROUTINE',
|
552
|
-
'ROUTINE_CATALOG',
|
553
|
-
'ROUTINE_NAME',
|
554
|
-
'ROUTINE_SCHEMA',
|
555
|
-
'ROW',
|
556
|
-
'ROWS',
|
557
|
-
'ROW_COUNT',
|
558
|
-
'ROW_NUMBER',
|
559
|
-
'RULE',
|
560
|
-
'SAVEPOINT',
|
561
|
-
'SCALE',
|
562
|
-
'SCHEMA',
|
563
|
-
'SCHEMA_NAME',
|
564
|
-
'SCOPE',
|
565
|
-
'SCOPE_CATALOG',
|
566
|
-
'SCOPE_NAME',
|
567
|
-
'SCOPE_SCHEMA',
|
568
|
-
'SCROLL',
|
569
|
-
'SEARCH',
|
570
|
-
'SECOND',
|
571
|
-
'SECTION',
|
572
|
-
'SECURITY',
|
573
|
-
'SELECT',
|
574
|
-
'SELECTIVE',
|
575
|
-
'SELF',
|
576
|
-
'SENSITIVE',
|
577
|
-
'SEQUENCE',
|
578
|
-
'SEQUENCES',
|
579
|
-
'SERIALIZABLE',
|
580
|
-
'SERVER',
|
581
|
-
'SERVER_NAME',
|
582
|
-
'SESSION',
|
583
|
-
'SESSION_USER',
|
584
|
-
'SET',
|
585
|
-
'SETOF',
|
586
|
-
'SETS',
|
587
|
-
'SHARE',
|
588
|
-
'SHOW',
|
589
|
-
'SIMILAR',
|
590
|
-
'SIMPLE',
|
591
|
-
'SIZE',
|
592
|
-
'SKIP',
|
593
|
-
'SMALLINT',
|
594
|
-
'SNAPSHOT',
|
595
|
-
'SOME',
|
596
|
-
'SOURCE',
|
597
|
-
'SPACE',
|
598
|
-
'SPECIFIC',
|
599
|
-
'SPECIFICTYPE',
|
600
|
-
'SPECIFIC_NAME',
|
601
|
-
'SQL',
|
602
|
-
'SQLCODE',
|
603
|
-
'SQLERROR',
|
604
|
-
'SQLEXCEPTION',
|
605
|
-
'SQLSTATE',
|
606
|
-
'SQLWARNING',
|
607
|
-
'SQRT',
|
608
|
-
'STABLE',
|
609
|
-
'STANDALONE',
|
610
|
-
'START',
|
611
|
-
'STATE',
|
612
|
-
'STATEMENT',
|
613
|
-
'STATIC',
|
614
|
-
'STATISTICS',
|
615
|
-
'STDDEV_POP',
|
616
|
-
'STDDEV_SAMP',
|
617
|
-
'STDIN',
|
618
|
-
'STDOUT',
|
619
|
-
'STORAGE',
|
620
|
-
'STRICT',
|
621
|
-
'STRIP',
|
622
|
-
'STRUCTURE',
|
623
|
-
'STYLE',
|
624
|
-
'SUBCLASS_ORIGIN',
|
625
|
-
'SUBMULTISET',
|
626
|
-
'SUBSTRING',
|
627
|
-
'SUBSTRING_REGEX',
|
628
|
-
'SUCCEEDS',
|
629
|
-
'SUM',
|
630
|
-
'SYMMETRIC',
|
631
|
-
'SYSID',
|
632
|
-
'SYSTEM',
|
633
|
-
'SYSTEM_TIME',
|
634
|
-
'SYSTEM_USER',
|
635
|
-
'T',
|
636
|
-
'TABLE',
|
637
|
-
'TABLES',
|
638
|
-
'TABLESAMPLE',
|
639
|
-
'TABLESPACE',
|
640
|
-
'TABLE_NAME',
|
641
|
-
'TEMP',
|
642
|
-
'TEMPLATE',
|
643
|
-
'TEMPORARY',
|
644
|
-
'TEXT',
|
645
|
-
'THEN',
|
646
|
-
'TIES',
|
647
|
-
'TIME',
|
648
|
-
'TIMESTAMP',
|
649
|
-
'TIMEZONE_HOUR',
|
650
|
-
'TIMEZONE_MINUTE',
|
651
|
-
'TO',
|
652
|
-
'TOKEN',
|
653
|
-
'TOP_LEVEL_COUNT',
|
654
|
-
'TRAILING',
|
655
|
-
'TRANSACTION',
|
656
|
-
'TRANSACTIONS_COMMITTED',
|
657
|
-
'TRANSACTIONS_ROLLED_BACK',
|
658
|
-
'TRANSACTION_ACTIVE',
|
659
|
-
'TRANSFORM',
|
660
|
-
'TRANSFORMS',
|
661
|
-
'TRANSLATE',
|
662
|
-
'TRANSLATE_REGEX',
|
663
|
-
'TRANSLATION',
|
664
|
-
'TREAT',
|
665
|
-
'TRIGGER',
|
666
|
-
'TRIGGER_CATALOG',
|
667
|
-
'TRIGGER_NAME',
|
668
|
-
'TRIGGER_SCHEMA',
|
669
|
-
'TRIM',
|
670
|
-
'TRIM_ARRAY',
|
671
|
-
'TRUE',
|
672
|
-
'TRUNCATE',
|
673
|
-
'TRUSTED',
|
674
|
-
'TYPE',
|
675
|
-
'TYPES',
|
676
|
-
'UESCAPE',
|
677
|
-
'UNBOUNDED',
|
678
|
-
'UNCOMMITTED',
|
679
|
-
'UNDER',
|
680
|
-
'UNENCRYPTED',
|
681
|
-
'UNION',
|
682
|
-
'UNIQUE',
|
683
|
-
'UNKNOWN',
|
684
|
-
'UNLINK',
|
685
|
-
'UNLISTEN',
|
686
|
-
'UNLOGGED',
|
687
|
-
'UNNAMED',
|
688
|
-
'UNNEST',
|
689
|
-
'UNTIL',
|
690
|
-
'UNTYPED',
|
691
|
-
'UPDATE',
|
692
|
-
'UPPER',
|
693
|
-
'URI',
|
694
|
-
'USAGE',
|
695
|
-
'USER',
|
696
|
-
'USER_DEFINED_TYPE_CATALOG',
|
697
|
-
'USER_DEFINED_TYPE_CODE',
|
698
|
-
'USER_DEFINED_TYPE_NAME',
|
699
|
-
'USER_DEFINED_TYPE_SCHEMA',
|
700
|
-
'USING',
|
701
|
-
'VACUUM',
|
702
|
-
'VALID',
|
703
|
-
'VALIDATE',
|
704
|
-
'VALIDATOR',
|
705
|
-
'VALUE',
|
706
|
-
'VALUES',
|
707
|
-
'VALUE_OF',
|
708
|
-
'VARBINARY',
|
709
|
-
'VARCHAR',
|
710
|
-
'VARIADIC',
|
711
|
-
'VARYING',
|
712
|
-
'VAR_POP',
|
713
|
-
'VAR_SAMP',
|
714
|
-
'VERBOSE',
|
715
|
-
'VERSION',
|
716
|
-
'VERSIONING',
|
717
|
-
'VIEW',
|
718
|
-
'VIEWS',
|
719
|
-
'VOLATILE',
|
720
|
-
'WHEN',
|
721
|
-
'WHENEVER',
|
722
|
-
'WHERE',
|
723
|
-
'WHITESPACE',
|
724
|
-
'WIDTH_BUCKET',
|
725
|
-
'WINDOW',
|
726
|
-
'WITH',
|
727
|
-
'WITHIN',
|
728
|
-
'WITHOUT',
|
729
|
-
'WORK',
|
730
|
-
'WRAPPER',
|
731
|
-
'WRITE',
|
732
|
-
'XML',
|
733
|
-
'XMLAGG',
|
734
|
-
'XMLATTRIBUTES',
|
735
|
-
'XMLBINARY',
|
736
|
-
'XMLCAST',
|
737
|
-
'XMLCOMMENT',
|
738
|
-
'XMLCONCAT',
|
739
|
-
'XMLDECLARATION',
|
740
|
-
'XMLDOCUMENT',
|
741
|
-
'XMLELEMENT',
|
742
|
-
'XMLEXISTS',
|
743
|
-
'XMLFOREST',
|
744
|
-
'XMLITERATE',
|
745
|
-
'XMLNAMESPACES',
|
746
|
-
'XMLPARSE',
|
747
|
-
'XMLPI',
|
748
|
-
'XMLQUERY',
|
749
|
-
'XMLROOT',
|
750
|
-
'XMLSCHEMA',
|
751
|
-
'XMLSERIALIZE',
|
752
|
-
'XMLTABLE',
|
753
|
-
'XMLTEXT',
|
754
|
-
'XMLVALIDATE',
|
755
|
-
'YEAR',
|
756
|
-
'YES',
|
757
|
-
'ZONE'
|
3
|
+
# Keywords that need to be escaped during deparsing. This matches they keywords
|
4
|
+
# excaped by quote_identifier in Postgres ruleutils.c. You can refresh this
|
5
|
+
# list using the kwlist.h file (make sure to ignore UNRESERVED_KEYWORD entries)
|
6
|
+
KEYWORDS = %w[
|
7
|
+
ALL
|
8
|
+
ANALYSE
|
9
|
+
ANALYZE
|
10
|
+
AND
|
11
|
+
ANY
|
12
|
+
ARRAY
|
13
|
+
AS
|
14
|
+
ASC
|
15
|
+
ASYMMETRIC
|
16
|
+
AUTHORIZATION
|
17
|
+
BETWEEN
|
18
|
+
BIGINT
|
19
|
+
BINARY
|
20
|
+
BIT
|
21
|
+
BOOLEAN
|
22
|
+
BOTH
|
23
|
+
CASE
|
24
|
+
CAST
|
25
|
+
CHAR
|
26
|
+
CHARACTER
|
27
|
+
CHECK
|
28
|
+
COALESCE
|
29
|
+
COLLATE
|
30
|
+
COLLATION
|
31
|
+
COLUMN
|
32
|
+
CONCURRENTLY
|
33
|
+
CONSTRAINT
|
34
|
+
CREATE
|
35
|
+
CROSS
|
36
|
+
CURRENT_CATALOG
|
37
|
+
CURRENT_DATE
|
38
|
+
CURRENT_ROLE
|
39
|
+
CURRENT_SCHEMA
|
40
|
+
CURRENT_TIME
|
41
|
+
CURRENT_TIMESTAMP
|
42
|
+
CURRENT_USER
|
43
|
+
DEC
|
44
|
+
DECIMAL
|
45
|
+
DEFAULT
|
46
|
+
DEFERRABLE
|
47
|
+
DESC
|
48
|
+
DISTINCT
|
49
|
+
DO
|
50
|
+
ELSE
|
51
|
+
END
|
52
|
+
EXCEPT
|
53
|
+
EXISTS
|
54
|
+
EXTRACT
|
55
|
+
FALSE
|
56
|
+
FETCH
|
57
|
+
FLOAT
|
58
|
+
FOR
|
59
|
+
FOREIGN
|
60
|
+
FREEZE
|
61
|
+
FROM
|
62
|
+
FULL
|
63
|
+
GRANT
|
64
|
+
GREATEST
|
65
|
+
GROUP
|
66
|
+
GROUPING
|
67
|
+
HAVING
|
68
|
+
ILIKE
|
69
|
+
IN
|
70
|
+
INITIALLY
|
71
|
+
INNER
|
72
|
+
INOUT
|
73
|
+
INT
|
74
|
+
INTEGER
|
75
|
+
INTERSECT
|
76
|
+
INTERVAL
|
77
|
+
INTO
|
78
|
+
IS
|
79
|
+
ISNULL
|
80
|
+
JOIN
|
81
|
+
LATERAL
|
82
|
+
LEADING
|
83
|
+
LEAST
|
84
|
+
LEFT
|
85
|
+
LIKE
|
86
|
+
LIMIT
|
87
|
+
LOCALTIME
|
88
|
+
LOCALTIMESTAMP
|
89
|
+
NATIONAL
|
90
|
+
NATURAL
|
91
|
+
NCHAR
|
92
|
+
NONE
|
93
|
+
NOT
|
94
|
+
NOTNULL
|
95
|
+
NULL
|
96
|
+
NULLIF
|
97
|
+
NUMERIC
|
98
|
+
OFFSET
|
99
|
+
ON
|
100
|
+
ONLY
|
101
|
+
OR
|
102
|
+
ORDER
|
103
|
+
OUT
|
104
|
+
OUTER
|
105
|
+
OVERLAPS
|
106
|
+
OVERLAY
|
107
|
+
PLACING
|
108
|
+
POSITION
|
109
|
+
PRECISION
|
110
|
+
PRIMARY
|
111
|
+
REAL
|
112
|
+
REFERENCES
|
113
|
+
RETURNING
|
114
|
+
RIGHT
|
115
|
+
ROW
|
116
|
+
SELECT
|
117
|
+
SESSION_USER
|
118
|
+
SETOF
|
119
|
+
SIMILAR
|
120
|
+
SMALLINT
|
121
|
+
SOME
|
122
|
+
SUBSTRING
|
123
|
+
SYMMETRIC
|
124
|
+
TABLE
|
125
|
+
TABLESAMPLE
|
126
|
+
THEN
|
127
|
+
TIME
|
128
|
+
TIMESTAMP
|
129
|
+
TO
|
130
|
+
TRAILING
|
131
|
+
TREAT
|
132
|
+
TRIM
|
133
|
+
TRUE
|
134
|
+
UNION
|
135
|
+
UNIQUE
|
136
|
+
USER
|
137
|
+
USING
|
138
|
+
VALUES
|
139
|
+
VARCHAR
|
140
|
+
VARIADIC
|
141
|
+
VERBOSE
|
142
|
+
WHEN
|
143
|
+
WHERE
|
144
|
+
WINDOW
|
145
|
+
WITH
|
146
|
+
XMLATTRIBUTES
|
147
|
+
XMLCONCAT
|
148
|
+
XMLELEMENT
|
149
|
+
XMLEXISTS
|
150
|
+
XMLFOREST
|
151
|
+
XMLNAMESPACES
|
152
|
+
XMLPARSE
|
153
|
+
XMLPI
|
154
|
+
XMLROOT
|
155
|
+
XMLSERIALIZE
|
156
|
+
XMLTABLE
|
758
157
|
].freeze
|
759
158
|
end
|
760
159
|
end
|
data/lib/pg_query/version.rb
CHANGED