1
0

reserved.go 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. package postgresql
  2. import "strings"
  3. // https://www.postgresql.org/docs/current/sql-keywords-appendix.html
  4. func (p *Parser) IsReservedKeyword(s string) bool {
  5. switch strings.ToLower(s) {
  6. case "all":
  7. case "analyse":
  8. case "analyze":
  9. case "and":
  10. case "any":
  11. case "array":
  12. case "as":
  13. case "asc":
  14. case "asymmetric":
  15. case "authorization":
  16. case "binary":
  17. case "both":
  18. case "case":
  19. case "cast":
  20. case "check":
  21. case "collate":
  22. case "collation":
  23. case "column":
  24. case "concurrently":
  25. case "constraint":
  26. case "create":
  27. case "cross":
  28. case "current_catalog":
  29. case "current_date":
  30. case "current_role":
  31. case "current_schema":
  32. case "current_time":
  33. case "current_timestamp":
  34. case "current_user":
  35. case "default":
  36. case "deferrable":
  37. case "desc":
  38. case "distinct":
  39. case "do":
  40. case "else":
  41. case "end":
  42. case "except":
  43. case "false":
  44. case "fetch":
  45. case "for":
  46. case "foreign":
  47. case "freeze":
  48. case "from":
  49. case "full":
  50. case "grant":
  51. case "group":
  52. case "having":
  53. case "ilike":
  54. case "in":
  55. case "initially":
  56. case "inner":
  57. case "intersect":
  58. case "into":
  59. case "is":
  60. case "isnull":
  61. case "join":
  62. case "lateral":
  63. case "leading":
  64. case "left":
  65. case "like":
  66. case "limit":
  67. case "localtime":
  68. case "localtimestamp":
  69. case "natural":
  70. case "not":
  71. case "notnull":
  72. case "null":
  73. case "offset":
  74. case "on":
  75. case "only":
  76. case "or":
  77. case "order":
  78. case "outer":
  79. case "overlaps":
  80. case "placing":
  81. case "primary":
  82. case "references":
  83. case "returning":
  84. case "right":
  85. case "select":
  86. case "session_user":
  87. case "similar":
  88. case "some":
  89. case "symmetric":
  90. case "table":
  91. case "tablesample":
  92. case "then":
  93. case "to":
  94. case "trailing":
  95. case "true":
  96. case "union":
  97. case "unique":
  98. case "user":
  99. case "using":
  100. case "variadic":
  101. case "verbose":
  102. case "when":
  103. case "where":
  104. case "window":
  105. case "with":
  106. default:
  107. return false
  108. }
  109. return true
  110. }