Skip to main content

rupg_sql/generated/
keywords.rs

1//! The keywords of PostgreSQL, with their tokens and categories.
2//!
3//! @generated by `cargo xtask sql` from `vendor/postgres-19/src/include/parser/kwlist.h` and `gram.y`. Do not edit. `cargo xtask sql --check` runs in CI and fails if this file and the vendored files disagree.
4//!
5//! A lookup is one perfect hash probe and one comparison. The words are in the order of `kwlist.h`, which is sorted.
6
7use super::tables::token;
8
9/// The category that decides where a keyword can be a name.
10#[derive(Clone, Copy, PartialEq, Eq, Debug)]
11pub enum Category {
12    /// A name anywhere.
13    Unreserved,
14    /// A column name, and not a function or a type name.
15    ColumnName,
16    /// A function or a type name, and not a column name.
17    TypeFuncName,
18    /// Never a name.
19    Reserved,
20}
21
22/// One keyword.
23#[derive(Debug)]
24pub struct Keyword {
25    /// The word, in lower case.
26    pub name: &'static str,
27    /// The token that the lexer gives for it.
28    pub token: u16,
29    /// Where the word can be a name.
30    pub category: Category,
31    /// True when the word can be a column label without `AS`.
32    pub bare_label: bool,
33}
34
35use Category::*;
36
37/// The longest keyword.
38pub(crate) const LONGEST: usize = 17;
39const BUCKETS: u32 = 256;
40const SLOT_BITS: u32 = 10;
41
42/// Every keyword.
43#[rustfmt::skip]
44pub(crate) static KEYWORDS: [Keyword; 499] = [
45    Keyword { name: "abort", token: token::ABORT_P, category: Unreserved, bare_label: true },
46    Keyword { name: "absent", token: token::ABSENT, category: Unreserved, bare_label: true },
47    Keyword { name: "absolute", token: token::ABSOLUTE_P, category: Unreserved, bare_label: true },
48    Keyword { name: "access", token: token::ACCESS, category: Unreserved, bare_label: true },
49    Keyword { name: "action", token: token::ACTION, category: Unreserved, bare_label: true },
50    Keyword { name: "add", token: token::ADD_P, category: Unreserved, bare_label: true },
51    Keyword { name: "admin", token: token::ADMIN, category: Unreserved, bare_label: true },
52    Keyword { name: "after", token: token::AFTER, category: Unreserved, bare_label: true },
53    Keyword { name: "aggregate", token: token::AGGREGATE, category: Unreserved, bare_label: true },
54    Keyword { name: "all", token: token::ALL, category: Reserved, bare_label: true },
55    Keyword { name: "also", token: token::ALSO, category: Unreserved, bare_label: true },
56    Keyword { name: "alter", token: token::ALTER, category: Unreserved, bare_label: true },
57    Keyword { name: "always", token: token::ALWAYS, category: Unreserved, bare_label: true },
58    Keyword { name: "analyse", token: token::ANALYSE, category: Reserved, bare_label: true },
59    Keyword { name: "analyze", token: token::ANALYZE, category: Reserved, bare_label: true },
60    Keyword { name: "and", token: token::AND, category: Reserved, bare_label: true },
61    Keyword { name: "any", token: token::ANY, category: Reserved, bare_label: true },
62    Keyword { name: "array", token: token::ARRAY, category: Reserved, bare_label: false },
63    Keyword { name: "as", token: token::AS, category: Reserved, bare_label: false },
64    Keyword { name: "asc", token: token::ASC, category: Reserved, bare_label: true },
65    Keyword { name: "asensitive", token: token::ASENSITIVE, category: Unreserved, bare_label: true },
66    Keyword { name: "assertion", token: token::ASSERTION, category: Unreserved, bare_label: true },
67    Keyword { name: "assignment", token: token::ASSIGNMENT, category: Unreserved, bare_label: true },
68    Keyword { name: "asymmetric", token: token::ASYMMETRIC, category: Reserved, bare_label: true },
69    Keyword { name: "at", token: token::AT, category: Unreserved, bare_label: true },
70    Keyword { name: "atomic", token: token::ATOMIC, category: Unreserved, bare_label: true },
71    Keyword { name: "attach", token: token::ATTACH, category: Unreserved, bare_label: true },
72    Keyword { name: "attribute", token: token::ATTRIBUTE, category: Unreserved, bare_label: true },
73    Keyword { name: "authorization", token: token::AUTHORIZATION, category: TypeFuncName, bare_label: true },
74    Keyword { name: "backward", token: token::BACKWARD, category: Unreserved, bare_label: true },
75    Keyword { name: "before", token: token::BEFORE, category: Unreserved, bare_label: true },
76    Keyword { name: "begin", token: token::BEGIN_P, category: Unreserved, bare_label: true },
77    Keyword { name: "between", token: token::BETWEEN, category: ColumnName, bare_label: true },
78    Keyword { name: "bigint", token: token::BIGINT, category: ColumnName, bare_label: true },
79    Keyword { name: "binary", token: token::BINARY, category: TypeFuncName, bare_label: true },
80    Keyword { name: "bit", token: token::BIT, category: ColumnName, bare_label: true },
81    Keyword { name: "boolean", token: token::BOOLEAN_P, category: ColumnName, bare_label: true },
82    Keyword { name: "both", token: token::BOTH, category: Reserved, bare_label: true },
83    Keyword { name: "breadth", token: token::BREADTH, category: Unreserved, bare_label: true },
84    Keyword { name: "by", token: token::BY, category: Unreserved, bare_label: true },
85    Keyword { name: "cache", token: token::CACHE, category: Unreserved, bare_label: true },
86    Keyword { name: "call", token: token::CALL, category: Unreserved, bare_label: true },
87    Keyword { name: "called", token: token::CALLED, category: Unreserved, bare_label: true },
88    Keyword { name: "cascade", token: token::CASCADE, category: Unreserved, bare_label: true },
89    Keyword { name: "cascaded", token: token::CASCADED, category: Unreserved, bare_label: true },
90    Keyword { name: "case", token: token::CASE, category: Reserved, bare_label: true },
91    Keyword { name: "cast", token: token::CAST, category: Reserved, bare_label: true },
92    Keyword { name: "catalog", token: token::CATALOG_P, category: Unreserved, bare_label: true },
93    Keyword { name: "chain", token: token::CHAIN, category: Unreserved, bare_label: true },
94    Keyword { name: "char", token: token::CHAR_P, category: ColumnName, bare_label: false },
95    Keyword { name: "character", token: token::CHARACTER, category: ColumnName, bare_label: false },
96    Keyword { name: "characteristics", token: token::CHARACTERISTICS, category: Unreserved, bare_label: true },
97    Keyword { name: "check", token: token::CHECK, category: Reserved, bare_label: true },
98    Keyword { name: "checkpoint", token: token::CHECKPOINT, category: Unreserved, bare_label: true },
99    Keyword { name: "class", token: token::CLASS, category: Unreserved, bare_label: true },
100    Keyword { name: "close", token: token::CLOSE, category: Unreserved, bare_label: true },
101    Keyword { name: "cluster", token: token::CLUSTER, category: Unreserved, bare_label: true },
102    Keyword { name: "coalesce", token: token::COALESCE, category: ColumnName, bare_label: true },
103    Keyword { name: "collate", token: token::COLLATE, category: Reserved, bare_label: true },
104    Keyword { name: "collation", token: token::COLLATION, category: TypeFuncName, bare_label: true },
105    Keyword { name: "column", token: token::COLUMN, category: Reserved, bare_label: true },
106    Keyword { name: "columns", token: token::COLUMNS, category: Unreserved, bare_label: true },
107    Keyword { name: "comment", token: token::COMMENT, category: Unreserved, bare_label: true },
108    Keyword { name: "comments", token: token::COMMENTS, category: Unreserved, bare_label: true },
109    Keyword { name: "commit", token: token::COMMIT, category: Unreserved, bare_label: true },
110    Keyword { name: "committed", token: token::COMMITTED, category: Unreserved, bare_label: true },
111    Keyword { name: "compression", token: token::COMPRESSION, category: Unreserved, bare_label: true },
112    Keyword { name: "concurrently", token: token::CONCURRENTLY, category: TypeFuncName, bare_label: true },
113    Keyword { name: "conditional", token: token::CONDITIONAL, category: Unreserved, bare_label: true },
114    Keyword { name: "configuration", token: token::CONFIGURATION, category: Unreserved, bare_label: true },
115    Keyword { name: "conflict", token: token::CONFLICT, category: Unreserved, bare_label: true },
116    Keyword { name: "connection", token: token::CONNECTION, category: Unreserved, bare_label: true },
117    Keyword { name: "constraint", token: token::CONSTRAINT, category: Reserved, bare_label: true },
118    Keyword { name: "constraints", token: token::CONSTRAINTS, category: Unreserved, bare_label: true },
119    Keyword { name: "content", token: token::CONTENT_P, category: Unreserved, bare_label: true },
120    Keyword { name: "continue", token: token::CONTINUE_P, category: Unreserved, bare_label: true },
121    Keyword { name: "conversion", token: token::CONVERSION_P, category: Unreserved, bare_label: true },
122    Keyword { name: "copy", token: token::COPY, category: Unreserved, bare_label: true },
123    Keyword { name: "cost", token: token::COST, category: Unreserved, bare_label: true },
124    Keyword { name: "create", token: token::CREATE, category: Reserved, bare_label: false },
125    Keyword { name: "cross", token: token::CROSS, category: TypeFuncName, bare_label: true },
126    Keyword { name: "csv", token: token::CSV, category: Unreserved, bare_label: true },
127    Keyword { name: "cube", token: token::CUBE, category: Unreserved, bare_label: true },
128    Keyword { name: "current", token: token::CURRENT_P, category: Unreserved, bare_label: true },
129    Keyword { name: "current_catalog", token: token::CURRENT_CATALOG, category: Reserved, bare_label: true },
130    Keyword { name: "current_date", token: token::CURRENT_DATE, category: Reserved, bare_label: true },
131    Keyword { name: "current_role", token: token::CURRENT_ROLE, category: Reserved, bare_label: true },
132    Keyword { name: "current_schema", token: token::CURRENT_SCHEMA, category: TypeFuncName, bare_label: true },
133    Keyword { name: "current_time", token: token::CURRENT_TIME, category: Reserved, bare_label: true },
134    Keyword { name: "current_timestamp", token: token::CURRENT_TIMESTAMP, category: Reserved, bare_label: true },
135    Keyword { name: "current_user", token: token::CURRENT_USER, category: Reserved, bare_label: true },
136    Keyword { name: "cursor", token: token::CURSOR, category: Unreserved, bare_label: true },
137    Keyword { name: "cycle", token: token::CYCLE, category: Unreserved, bare_label: true },
138    Keyword { name: "data", token: token::DATA_P, category: Unreserved, bare_label: true },
139    Keyword { name: "database", token: token::DATABASE, category: Unreserved, bare_label: true },
140    Keyword { name: "day", token: token::DAY_P, category: Unreserved, bare_label: false },
141    Keyword { name: "deallocate", token: token::DEALLOCATE, category: Unreserved, bare_label: true },
142    Keyword { name: "dec", token: token::DEC, category: ColumnName, bare_label: true },
143    Keyword { name: "decimal", token: token::DECIMAL_P, category: ColumnName, bare_label: true },
144    Keyword { name: "declare", token: token::DECLARE, category: Unreserved, bare_label: true },
145    Keyword { name: "default", token: token::DEFAULT, category: Reserved, bare_label: true },
146    Keyword { name: "defaults", token: token::DEFAULTS, category: Unreserved, bare_label: true },
147    Keyword { name: "deferrable", token: token::DEFERRABLE, category: Reserved, bare_label: true },
148    Keyword { name: "deferred", token: token::DEFERRED, category: Unreserved, bare_label: true },
149    Keyword { name: "definer", token: token::DEFINER, category: Unreserved, bare_label: true },
150    Keyword { name: "delete", token: token::DELETE_P, category: Unreserved, bare_label: true },
151    Keyword { name: "delimiter", token: token::DELIMITER, category: Unreserved, bare_label: true },
152    Keyword { name: "delimiters", token: token::DELIMITERS, category: Unreserved, bare_label: true },
153    Keyword { name: "depends", token: token::DEPENDS, category: Unreserved, bare_label: true },
154    Keyword { name: "depth", token: token::DEPTH, category: Unreserved, bare_label: true },
155    Keyword { name: "desc", token: token::DESC, category: Reserved, bare_label: true },
156    Keyword { name: "detach", token: token::DETACH, category: Unreserved, bare_label: true },
157    Keyword { name: "dictionary", token: token::DICTIONARY, category: Unreserved, bare_label: true },
158    Keyword { name: "disable", token: token::DISABLE_P, category: Unreserved, bare_label: true },
159    Keyword { name: "discard", token: token::DISCARD, category: Unreserved, bare_label: true },
160    Keyword { name: "distinct", token: token::DISTINCT, category: Reserved, bare_label: true },
161    Keyword { name: "do", token: token::DO, category: Reserved, bare_label: true },
162    Keyword { name: "document", token: token::DOCUMENT_P, category: Unreserved, bare_label: true },
163    Keyword { name: "domain", token: token::DOMAIN_P, category: Unreserved, bare_label: true },
164    Keyword { name: "double", token: token::DOUBLE_P, category: Unreserved, bare_label: true },
165    Keyword { name: "drop", token: token::DROP, category: Unreserved, bare_label: true },
166    Keyword { name: "each", token: token::EACH, category: Unreserved, bare_label: true },
167    Keyword { name: "else", token: token::ELSE, category: Reserved, bare_label: true },
168    Keyword { name: "empty", token: token::EMPTY_P, category: Unreserved, bare_label: true },
169    Keyword { name: "enable", token: token::ENABLE_P, category: Unreserved, bare_label: true },
170    Keyword { name: "encoding", token: token::ENCODING, category: Unreserved, bare_label: true },
171    Keyword { name: "encrypted", token: token::ENCRYPTED, category: Unreserved, bare_label: true },
172    Keyword { name: "end", token: token::END_P, category: Reserved, bare_label: true },
173    Keyword { name: "enforced", token: token::ENFORCED, category: Unreserved, bare_label: true },
174    Keyword { name: "enum", token: token::ENUM_P, category: Unreserved, bare_label: true },
175    Keyword { name: "error", token: token::ERROR_P, category: Unreserved, bare_label: true },
176    Keyword { name: "escape", token: token::ESCAPE, category: Unreserved, bare_label: true },
177    Keyword { name: "event", token: token::EVENT, category: Unreserved, bare_label: true },
178    Keyword { name: "except", token: token::EXCEPT, category: Reserved, bare_label: false },
179    Keyword { name: "exclude", token: token::EXCLUDE, category: Unreserved, bare_label: true },
180    Keyword { name: "excluding", token: token::EXCLUDING, category: Unreserved, bare_label: true },
181    Keyword { name: "exclusive", token: token::EXCLUSIVE, category: Unreserved, bare_label: true },
182    Keyword { name: "execute", token: token::EXECUTE, category: Unreserved, bare_label: true },
183    Keyword { name: "exists", token: token::EXISTS, category: ColumnName, bare_label: true },
184    Keyword { name: "explain", token: token::EXPLAIN, category: Unreserved, bare_label: true },
185    Keyword { name: "expression", token: token::EXPRESSION, category: Unreserved, bare_label: true },
186    Keyword { name: "extension", token: token::EXTENSION, category: Unreserved, bare_label: true },
187    Keyword { name: "external", token: token::EXTERNAL, category: Unreserved, bare_label: true },
188    Keyword { name: "extract", token: token::EXTRACT, category: ColumnName, bare_label: true },
189    Keyword { name: "false", token: token::FALSE_P, category: Reserved, bare_label: true },
190    Keyword { name: "family", token: token::FAMILY, category: Unreserved, bare_label: true },
191    Keyword { name: "fetch", token: token::FETCH, category: Reserved, bare_label: false },
192    Keyword { name: "filter", token: token::FILTER, category: Unreserved, bare_label: false },
193    Keyword { name: "finalize", token: token::FINALIZE, category: Unreserved, bare_label: true },
194    Keyword { name: "first", token: token::FIRST_P, category: Unreserved, bare_label: true },
195    Keyword { name: "float", token: token::FLOAT_P, category: ColumnName, bare_label: true },
196    Keyword { name: "following", token: token::FOLLOWING, category: Unreserved, bare_label: true },
197    Keyword { name: "for", token: token::FOR, category: Reserved, bare_label: false },
198    Keyword { name: "force", token: token::FORCE, category: Unreserved, bare_label: true },
199    Keyword { name: "foreign", token: token::FOREIGN, category: Reserved, bare_label: true },
200    Keyword { name: "format", token: token::FORMAT, category: Unreserved, bare_label: true },
201    Keyword { name: "forward", token: token::FORWARD, category: Unreserved, bare_label: true },
202    Keyword { name: "freeze", token: token::FREEZE, category: TypeFuncName, bare_label: true },
203    Keyword { name: "from", token: token::FROM, category: Reserved, bare_label: false },
204    Keyword { name: "full", token: token::FULL, category: TypeFuncName, bare_label: true },
205    Keyword { name: "function", token: token::FUNCTION, category: Unreserved, bare_label: true },
206    Keyword { name: "functions", token: token::FUNCTIONS, category: Unreserved, bare_label: true },
207    Keyword { name: "generated", token: token::GENERATED, category: Unreserved, bare_label: true },
208    Keyword { name: "global", token: token::GLOBAL, category: Unreserved, bare_label: true },
209    Keyword { name: "grant", token: token::GRANT, category: Reserved, bare_label: false },
210    Keyword { name: "granted", token: token::GRANTED, category: Unreserved, bare_label: true },
211    Keyword { name: "greatest", token: token::GREATEST, category: ColumnName, bare_label: true },
212    Keyword { name: "group", token: token::GROUP_P, category: Reserved, bare_label: false },
213    Keyword { name: "grouping", token: token::GROUPING, category: ColumnName, bare_label: true },
214    Keyword { name: "groups", token: token::GROUPS, category: Unreserved, bare_label: true },
215    Keyword { name: "handler", token: token::HANDLER, category: Unreserved, bare_label: true },
216    Keyword { name: "having", token: token::HAVING, category: Reserved, bare_label: false },
217    Keyword { name: "header", token: token::HEADER_P, category: Unreserved, bare_label: true },
218    Keyword { name: "hold", token: token::HOLD, category: Unreserved, bare_label: true },
219    Keyword { name: "hour", token: token::HOUR_P, category: Unreserved, bare_label: false },
220    Keyword { name: "identity", token: token::IDENTITY_P, category: Unreserved, bare_label: true },
221    Keyword { name: "if", token: token::IF_P, category: Unreserved, bare_label: true },
222    Keyword { name: "ignore", token: token::IGNORE_P, category: Unreserved, bare_label: false },
223    Keyword { name: "ilike", token: token::ILIKE, category: TypeFuncName, bare_label: true },
224    Keyword { name: "immediate", token: token::IMMEDIATE, category: Unreserved, bare_label: true },
225    Keyword { name: "immutable", token: token::IMMUTABLE, category: Unreserved, bare_label: true },
226    Keyword { name: "implicit", token: token::IMPLICIT_P, category: Unreserved, bare_label: true },
227    Keyword { name: "import", token: token::IMPORT_P, category: Unreserved, bare_label: true },
228    Keyword { name: "in", token: token::IN_P, category: Reserved, bare_label: true },
229    Keyword { name: "include", token: token::INCLUDE, category: Unreserved, bare_label: true },
230    Keyword { name: "including", token: token::INCLUDING, category: Unreserved, bare_label: true },
231    Keyword { name: "increment", token: token::INCREMENT, category: Unreserved, bare_label: true },
232    Keyword { name: "indent", token: token::INDENT, category: Unreserved, bare_label: true },
233    Keyword { name: "index", token: token::INDEX, category: Unreserved, bare_label: true },
234    Keyword { name: "indexes", token: token::INDEXES, category: Unreserved, bare_label: true },
235    Keyword { name: "inherit", token: token::INHERIT, category: Unreserved, bare_label: true },
236    Keyword { name: "inherits", token: token::INHERITS, category: Unreserved, bare_label: true },
237    Keyword { name: "initially", token: token::INITIALLY, category: Reserved, bare_label: true },
238    Keyword { name: "inline", token: token::INLINE_P, category: Unreserved, bare_label: true },
239    Keyword { name: "inner", token: token::INNER_P, category: TypeFuncName, bare_label: true },
240    Keyword { name: "inout", token: token::INOUT, category: ColumnName, bare_label: true },
241    Keyword { name: "input", token: token::INPUT_P, category: Unreserved, bare_label: true },
242    Keyword { name: "insensitive", token: token::INSENSITIVE, category: Unreserved, bare_label: true },
243    Keyword { name: "insert", token: token::INSERT, category: Unreserved, bare_label: true },
244    Keyword { name: "instead", token: token::INSTEAD, category: Unreserved, bare_label: true },
245    Keyword { name: "int", token: token::INT_P, category: ColumnName, bare_label: true },
246    Keyword { name: "integer", token: token::INTEGER, category: ColumnName, bare_label: true },
247    Keyword { name: "intersect", token: token::INTERSECT, category: Reserved, bare_label: false },
248    Keyword { name: "interval", token: token::INTERVAL, category: ColumnName, bare_label: true },
249    Keyword { name: "into", token: token::INTO, category: Reserved, bare_label: false },
250    Keyword { name: "invoker", token: token::INVOKER, category: Unreserved, bare_label: true },
251    Keyword { name: "is", token: token::IS, category: TypeFuncName, bare_label: true },
252    Keyword { name: "isnull", token: token::ISNULL, category: TypeFuncName, bare_label: false },
253    Keyword { name: "isolation", token: token::ISOLATION, category: Unreserved, bare_label: true },
254    Keyword { name: "join", token: token::JOIN, category: TypeFuncName, bare_label: true },
255    Keyword { name: "json", token: token::JSON, category: ColumnName, bare_label: true },
256    Keyword { name: "json_array", token: token::JSON_ARRAY, category: ColumnName, bare_label: true },
257    Keyword { name: "json_arrayagg", token: token::JSON_ARRAYAGG, category: ColumnName, bare_label: true },
258    Keyword { name: "json_exists", token: token::JSON_EXISTS, category: ColumnName, bare_label: true },
259    Keyword { name: "json_object", token: token::JSON_OBJECT, category: ColumnName, bare_label: true },
260    Keyword { name: "json_objectagg", token: token::JSON_OBJECTAGG, category: ColumnName, bare_label: true },
261    Keyword { name: "json_query", token: token::JSON_QUERY, category: ColumnName, bare_label: true },
262    Keyword { name: "json_scalar", token: token::JSON_SCALAR, category: ColumnName, bare_label: true },
263    Keyword { name: "json_serialize", token: token::JSON_SERIALIZE, category: ColumnName, bare_label: true },
264    Keyword { name: "json_table", token: token::JSON_TABLE, category: ColumnName, bare_label: true },
265    Keyword { name: "json_value", token: token::JSON_VALUE, category: ColumnName, bare_label: true },
266    Keyword { name: "keep", token: token::KEEP, category: Unreserved, bare_label: true },
267    Keyword { name: "key", token: token::KEY, category: Unreserved, bare_label: true },
268    Keyword { name: "keys", token: token::KEYS, category: Unreserved, bare_label: true },
269    Keyword { name: "label", token: token::LABEL, category: Unreserved, bare_label: true },
270    Keyword { name: "language", token: token::LANGUAGE, category: Unreserved, bare_label: true },
271    Keyword { name: "large", token: token::LARGE_P, category: Unreserved, bare_label: true },
272    Keyword { name: "last", token: token::LAST_P, category: Unreserved, bare_label: true },
273    Keyword { name: "lateral", token: token::LATERAL_P, category: Reserved, bare_label: true },
274    Keyword { name: "leading", token: token::LEADING, category: Reserved, bare_label: true },
275    Keyword { name: "leakproof", token: token::LEAKPROOF, category: Unreserved, bare_label: true },
276    Keyword { name: "least", token: token::LEAST, category: ColumnName, bare_label: true },
277    Keyword { name: "left", token: token::LEFT, category: TypeFuncName, bare_label: true },
278    Keyword { name: "level", token: token::LEVEL, category: Unreserved, bare_label: true },
279    Keyword { name: "like", token: token::LIKE, category: TypeFuncName, bare_label: true },
280    Keyword { name: "limit", token: token::LIMIT, category: Reserved, bare_label: false },
281    Keyword { name: "listen", token: token::LISTEN, category: Unreserved, bare_label: true },
282    Keyword { name: "load", token: token::LOAD, category: Unreserved, bare_label: true },
283    Keyword { name: "local", token: token::LOCAL, category: Unreserved, bare_label: true },
284    Keyword { name: "localtime", token: token::LOCALTIME, category: Reserved, bare_label: true },
285    Keyword { name: "localtimestamp", token: token::LOCALTIMESTAMP, category: Reserved, bare_label: true },
286    Keyword { name: "location", token: token::LOCATION, category: Unreserved, bare_label: true },
287    Keyword { name: "lock", token: token::LOCK_P, category: Unreserved, bare_label: true },
288    Keyword { name: "locked", token: token::LOCKED, category: Unreserved, bare_label: true },
289    Keyword { name: "logged", token: token::LOGGED, category: Unreserved, bare_label: true },
290    Keyword { name: "lsn", token: token::LSN_P, category: Unreserved, bare_label: true },
291    Keyword { name: "mapping", token: token::MAPPING, category: Unreserved, bare_label: true },
292    Keyword { name: "match", token: token::MATCH, category: Unreserved, bare_label: true },
293    Keyword { name: "matched", token: token::MATCHED, category: Unreserved, bare_label: true },
294    Keyword { name: "materialized", token: token::MATERIALIZED, category: Unreserved, bare_label: true },
295    Keyword { name: "maxvalue", token: token::MAXVALUE, category: Unreserved, bare_label: true },
296    Keyword { name: "merge", token: token::MERGE, category: Unreserved, bare_label: true },
297    Keyword { name: "merge_action", token: token::MERGE_ACTION, category: ColumnName, bare_label: true },
298    Keyword { name: "method", token: token::METHOD, category: Unreserved, bare_label: true },
299    Keyword { name: "minute", token: token::MINUTE_P, category: Unreserved, bare_label: false },
300    Keyword { name: "minvalue", token: token::MINVALUE, category: Unreserved, bare_label: true },
301    Keyword { name: "mode", token: token::MODE, category: Unreserved, bare_label: true },
302    Keyword { name: "month", token: token::MONTH_P, category: Unreserved, bare_label: false },
303    Keyword { name: "move", token: token::MOVE, category: Unreserved, bare_label: true },
304    Keyword { name: "name", token: token::NAME_P, category: Unreserved, bare_label: true },
305    Keyword { name: "names", token: token::NAMES, category: Unreserved, bare_label: true },
306    Keyword { name: "national", token: token::NATIONAL, category: ColumnName, bare_label: true },
307    Keyword { name: "natural", token: token::NATURAL, category: TypeFuncName, bare_label: true },
308    Keyword { name: "nchar", token: token::NCHAR, category: ColumnName, bare_label: true },
309    Keyword { name: "nested", token: token::NESTED, category: Unreserved, bare_label: true },
310    Keyword { name: "new", token: token::NEW, category: Unreserved, bare_label: true },
311    Keyword { name: "next", token: token::NEXT, category: Unreserved, bare_label: true },
312    Keyword { name: "nfc", token: token::NFC, category: Unreserved, bare_label: true },
313    Keyword { name: "nfd", token: token::NFD, category: Unreserved, bare_label: true },
314    Keyword { name: "nfkc", token: token::NFKC, category: Unreserved, bare_label: true },
315    Keyword { name: "nfkd", token: token::NFKD, category: Unreserved, bare_label: true },
316    Keyword { name: "no", token: token::NO, category: Unreserved, bare_label: true },
317    Keyword { name: "none", token: token::NONE, category: ColumnName, bare_label: true },
318    Keyword { name: "normalize", token: token::NORMALIZE, category: ColumnName, bare_label: true },
319    Keyword { name: "normalized", token: token::NORMALIZED, category: Unreserved, bare_label: true },
320    Keyword { name: "not", token: token::NOT, category: Reserved, bare_label: true },
321    Keyword { name: "nothing", token: token::NOTHING, category: Unreserved, bare_label: true },
322    Keyword { name: "notify", token: token::NOTIFY, category: Unreserved, bare_label: true },
323    Keyword { name: "notnull", token: token::NOTNULL, category: TypeFuncName, bare_label: false },
324    Keyword { name: "nowait", token: token::NOWAIT, category: Unreserved, bare_label: true },
325    Keyword { name: "null", token: token::NULL_P, category: Reserved, bare_label: true },
326    Keyword { name: "nullif", token: token::NULLIF, category: ColumnName, bare_label: true },
327    Keyword { name: "nulls", token: token::NULLS_P, category: Unreserved, bare_label: true },
328    Keyword { name: "numeric", token: token::NUMERIC, category: ColumnName, bare_label: true },
329    Keyword { name: "object", token: token::OBJECT_P, category: Unreserved, bare_label: true },
330    Keyword { name: "objects", token: token::OBJECTS_P, category: Unreserved, bare_label: true },
331    Keyword { name: "of", token: token::OF, category: Unreserved, bare_label: true },
332    Keyword { name: "off", token: token::OFF, category: Unreserved, bare_label: true },
333    Keyword { name: "offset", token: token::OFFSET, category: Reserved, bare_label: false },
334    Keyword { name: "oids", token: token::OIDS, category: Unreserved, bare_label: true },
335    Keyword { name: "old", token: token::OLD, category: Unreserved, bare_label: true },
336    Keyword { name: "omit", token: token::OMIT, category: Unreserved, bare_label: true },
337    Keyword { name: "on", token: token::ON, category: Reserved, bare_label: false },
338    Keyword { name: "only", token: token::ONLY, category: Reserved, bare_label: true },
339    Keyword { name: "operator", token: token::OPERATOR, category: Unreserved, bare_label: true },
340    Keyword { name: "option", token: token::OPTION, category: Unreserved, bare_label: true },
341    Keyword { name: "options", token: token::OPTIONS, category: Unreserved, bare_label: true },
342    Keyword { name: "or", token: token::OR, category: Reserved, bare_label: true },
343    Keyword { name: "order", token: token::ORDER, category: Reserved, bare_label: false },
344    Keyword { name: "ordinality", token: token::ORDINALITY, category: Unreserved, bare_label: true },
345    Keyword { name: "others", token: token::OTHERS, category: Unreserved, bare_label: true },
346    Keyword { name: "out", token: token::OUT_P, category: ColumnName, bare_label: true },
347    Keyword { name: "outer", token: token::OUTER_P, category: TypeFuncName, bare_label: true },
348    Keyword { name: "over", token: token::OVER, category: Unreserved, bare_label: false },
349    Keyword { name: "overlaps", token: token::OVERLAPS, category: TypeFuncName, bare_label: false },
350    Keyword { name: "overlay", token: token::OVERLAY, category: ColumnName, bare_label: true },
351    Keyword { name: "overriding", token: token::OVERRIDING, category: Unreserved, bare_label: true },
352    Keyword { name: "owned", token: token::OWNED, category: Unreserved, bare_label: true },
353    Keyword { name: "owner", token: token::OWNER, category: Unreserved, bare_label: true },
354    Keyword { name: "parallel", token: token::PARALLEL, category: Unreserved, bare_label: true },
355    Keyword { name: "parameter", token: token::PARAMETER, category: Unreserved, bare_label: true },
356    Keyword { name: "parser", token: token::PARSER, category: Unreserved, bare_label: true },
357    Keyword { name: "partial", token: token::PARTIAL, category: Unreserved, bare_label: true },
358    Keyword { name: "partition", token: token::PARTITION, category: Unreserved, bare_label: true },
359    Keyword { name: "passing", token: token::PASSING, category: Unreserved, bare_label: true },
360    Keyword { name: "password", token: token::PASSWORD, category: Unreserved, bare_label: true },
361    Keyword { name: "path", token: token::PATH, category: Unreserved, bare_label: true },
362    Keyword { name: "period", token: token::PERIOD, category: Unreserved, bare_label: true },
363    Keyword { name: "placing", token: token::PLACING, category: Reserved, bare_label: true },
364    Keyword { name: "plan", token: token::PLAN, category: Unreserved, bare_label: true },
365    Keyword { name: "plans", token: token::PLANS, category: Unreserved, bare_label: true },
366    Keyword { name: "policy", token: token::POLICY, category: Unreserved, bare_label: true },
367    Keyword { name: "position", token: token::POSITION, category: ColumnName, bare_label: true },
368    Keyword { name: "preceding", token: token::PRECEDING, category: Unreserved, bare_label: true },
369    Keyword { name: "precision", token: token::PRECISION, category: ColumnName, bare_label: false },
370    Keyword { name: "prepare", token: token::PREPARE, category: Unreserved, bare_label: true },
371    Keyword { name: "prepared", token: token::PREPARED, category: Unreserved, bare_label: true },
372    Keyword { name: "preserve", token: token::PRESERVE, category: Unreserved, bare_label: true },
373    Keyword { name: "primary", token: token::PRIMARY, category: Reserved, bare_label: true },
374    Keyword { name: "prior", token: token::PRIOR, category: Unreserved, bare_label: true },
375    Keyword { name: "privileges", token: token::PRIVILEGES, category: Unreserved, bare_label: true },
376    Keyword { name: "procedural", token: token::PROCEDURAL, category: Unreserved, bare_label: true },
377    Keyword { name: "procedure", token: token::PROCEDURE, category: Unreserved, bare_label: true },
378    Keyword { name: "procedures", token: token::PROCEDURES, category: Unreserved, bare_label: true },
379    Keyword { name: "program", token: token::PROGRAM, category: Unreserved, bare_label: true },
380    Keyword { name: "publication", token: token::PUBLICATION, category: Unreserved, bare_label: true },
381    Keyword { name: "quote", token: token::QUOTE, category: Unreserved, bare_label: true },
382    Keyword { name: "quotes", token: token::QUOTES, category: Unreserved, bare_label: true },
383    Keyword { name: "range", token: token::RANGE, category: Unreserved, bare_label: true },
384    Keyword { name: "read", token: token::READ, category: Unreserved, bare_label: true },
385    Keyword { name: "real", token: token::REAL, category: ColumnName, bare_label: true },
386    Keyword { name: "reassign", token: token::REASSIGN, category: Unreserved, bare_label: true },
387    Keyword { name: "recursive", token: token::RECURSIVE, category: Unreserved, bare_label: true },
388    Keyword { name: "ref", token: token::REF_P, category: Unreserved, bare_label: true },
389    Keyword { name: "references", token: token::REFERENCES, category: Reserved, bare_label: true },
390    Keyword { name: "referencing", token: token::REFERENCING, category: Unreserved, bare_label: true },
391    Keyword { name: "refresh", token: token::REFRESH, category: Unreserved, bare_label: true },
392    Keyword { name: "reindex", token: token::REINDEX, category: Unreserved, bare_label: true },
393    Keyword { name: "relative", token: token::RELATIVE_P, category: Unreserved, bare_label: true },
394    Keyword { name: "release", token: token::RELEASE, category: Unreserved, bare_label: true },
395    Keyword { name: "rename", token: token::RENAME, category: Unreserved, bare_label: true },
396    Keyword { name: "repack", token: token::REPACK, category: Unreserved, bare_label: true },
397    Keyword { name: "repeatable", token: token::REPEATABLE, category: Unreserved, bare_label: true },
398    Keyword { name: "replace", token: token::REPLACE, category: Unreserved, bare_label: true },
399    Keyword { name: "replica", token: token::REPLICA, category: Unreserved, bare_label: true },
400    Keyword { name: "reset", token: token::RESET, category: Unreserved, bare_label: true },
401    Keyword { name: "respect", token: token::RESPECT_P, category: Unreserved, bare_label: false },
402    Keyword { name: "restart", token: token::RESTART, category: Unreserved, bare_label: true },
403    Keyword { name: "restrict", token: token::RESTRICT, category: Unreserved, bare_label: true },
404    Keyword { name: "return", token: token::RETURN, category: Unreserved, bare_label: true },
405    Keyword { name: "returning", token: token::RETURNING, category: Reserved, bare_label: false },
406    Keyword { name: "returns", token: token::RETURNS, category: Unreserved, bare_label: true },
407    Keyword { name: "revoke", token: token::REVOKE, category: Unreserved, bare_label: true },
408    Keyword { name: "right", token: token::RIGHT, category: TypeFuncName, bare_label: true },
409    Keyword { name: "role", token: token::ROLE, category: Unreserved, bare_label: true },
410    Keyword { name: "rollback", token: token::ROLLBACK, category: Unreserved, bare_label: true },
411    Keyword { name: "rollup", token: token::ROLLUP, category: Unreserved, bare_label: true },
412    Keyword { name: "routine", token: token::ROUTINE, category: Unreserved, bare_label: true },
413    Keyword { name: "routines", token: token::ROUTINES, category: Unreserved, bare_label: true },
414    Keyword { name: "row", token: token::ROW, category: ColumnName, bare_label: true },
415    Keyword { name: "rows", token: token::ROWS, category: Unreserved, bare_label: true },
416    Keyword { name: "rule", token: token::RULE, category: Unreserved, bare_label: true },
417    Keyword { name: "savepoint", token: token::SAVEPOINT, category: Unreserved, bare_label: true },
418    Keyword { name: "scalar", token: token::SCALAR, category: Unreserved, bare_label: true },
419    Keyword { name: "schema", token: token::SCHEMA, category: Unreserved, bare_label: true },
420    Keyword { name: "schemas", token: token::SCHEMAS, category: Unreserved, bare_label: true },
421    Keyword { name: "scroll", token: token::SCROLL, category: Unreserved, bare_label: true },
422    Keyword { name: "search", token: token::SEARCH, category: Unreserved, bare_label: true },
423    Keyword { name: "second", token: token::SECOND_P, category: Unreserved, bare_label: false },
424    Keyword { name: "security", token: token::SECURITY, category: Unreserved, bare_label: true },
425    Keyword { name: "select", token: token::SELECT, category: Reserved, bare_label: true },
426    Keyword { name: "sequence", token: token::SEQUENCE, category: Unreserved, bare_label: true },
427    Keyword { name: "sequences", token: token::SEQUENCES, category: Unreserved, bare_label: true },
428    Keyword { name: "serializable", token: token::SERIALIZABLE, category: Unreserved, bare_label: true },
429    Keyword { name: "server", token: token::SERVER, category: Unreserved, bare_label: true },
430    Keyword { name: "session", token: token::SESSION, category: Unreserved, bare_label: true },
431    Keyword { name: "session_user", token: token::SESSION_USER, category: Reserved, bare_label: true },
432    Keyword { name: "set", token: token::SET, category: Unreserved, bare_label: true },
433    Keyword { name: "setof", token: token::SETOF, category: ColumnName, bare_label: true },
434    Keyword { name: "sets", token: token::SETS, category: Unreserved, bare_label: true },
435    Keyword { name: "share", token: token::SHARE, category: Unreserved, bare_label: true },
436    Keyword { name: "show", token: token::SHOW, category: Unreserved, bare_label: true },
437    Keyword { name: "similar", token: token::SIMILAR, category: TypeFuncName, bare_label: true },
438    Keyword { name: "simple", token: token::SIMPLE, category: Unreserved, bare_label: true },
439    Keyword { name: "skip", token: token::SKIP, category: Unreserved, bare_label: true },
440    Keyword { name: "smallint", token: token::SMALLINT, category: ColumnName, bare_label: true },
441    Keyword { name: "snapshot", token: token::SNAPSHOT, category: Unreserved, bare_label: true },
442    Keyword { name: "some", token: token::SOME, category: Reserved, bare_label: true },
443    Keyword { name: "source", token: token::SOURCE, category: Unreserved, bare_label: true },
444    Keyword { name: "sql", token: token::SQL_P, category: Unreserved, bare_label: true },
445    Keyword { name: "stable", token: token::STABLE, category: Unreserved, bare_label: true },
446    Keyword { name: "standalone", token: token::STANDALONE_P, category: Unreserved, bare_label: true },
447    Keyword { name: "start", token: token::START, category: Unreserved, bare_label: true },
448    Keyword { name: "statement", token: token::STATEMENT, category: Unreserved, bare_label: true },
449    Keyword { name: "statistics", token: token::STATISTICS, category: Unreserved, bare_label: true },
450    Keyword { name: "stdin", token: token::STDIN, category: Unreserved, bare_label: true },
451    Keyword { name: "stdout", token: token::STDOUT, category: Unreserved, bare_label: true },
452    Keyword { name: "storage", token: token::STORAGE, category: Unreserved, bare_label: true },
453    Keyword { name: "stored", token: token::STORED, category: Unreserved, bare_label: true },
454    Keyword { name: "strict", token: token::STRICT_P, category: Unreserved, bare_label: true },
455    Keyword { name: "string", token: token::STRING_P, category: Unreserved, bare_label: true },
456    Keyword { name: "strip", token: token::STRIP_P, category: Unreserved, bare_label: true },
457    Keyword { name: "subscription", token: token::SUBSCRIPTION, category: Unreserved, bare_label: true },
458    Keyword { name: "substring", token: token::SUBSTRING, category: ColumnName, bare_label: true },
459    Keyword { name: "support", token: token::SUPPORT, category: Unreserved, bare_label: true },
460    Keyword { name: "symmetric", token: token::SYMMETRIC, category: Reserved, bare_label: true },
461    Keyword { name: "sysid", token: token::SYSID, category: Unreserved, bare_label: true },
462    Keyword { name: "system", token: token::SYSTEM_P, category: Unreserved, bare_label: true },
463    Keyword { name: "system_user", token: token::SYSTEM_USER, category: Reserved, bare_label: true },
464    Keyword { name: "table", token: token::TABLE, category: Reserved, bare_label: true },
465    Keyword { name: "tables", token: token::TABLES, category: Unreserved, bare_label: true },
466    Keyword { name: "tablesample", token: token::TABLESAMPLE, category: TypeFuncName, bare_label: true },
467    Keyword { name: "tablespace", token: token::TABLESPACE, category: Unreserved, bare_label: true },
468    Keyword { name: "target", token: token::TARGET, category: Unreserved, bare_label: true },
469    Keyword { name: "temp", token: token::TEMP, category: Unreserved, bare_label: true },
470    Keyword { name: "template", token: token::TEMPLATE, category: Unreserved, bare_label: true },
471    Keyword { name: "temporary", token: token::TEMPORARY, category: Unreserved, bare_label: true },
472    Keyword { name: "text", token: token::TEXT_P, category: Unreserved, bare_label: true },
473    Keyword { name: "then", token: token::THEN, category: Reserved, bare_label: true },
474    Keyword { name: "ties", token: token::TIES, category: Unreserved, bare_label: true },
475    Keyword { name: "time", token: token::TIME, category: ColumnName, bare_label: true },
476    Keyword { name: "timestamp", token: token::TIMESTAMP, category: ColumnName, bare_label: true },
477    Keyword { name: "to", token: token::TO, category: Reserved, bare_label: false },
478    Keyword { name: "trailing", token: token::TRAILING, category: Reserved, bare_label: true },
479    Keyword { name: "transaction", token: token::TRANSACTION, category: Unreserved, bare_label: true },
480    Keyword { name: "transform", token: token::TRANSFORM, category: Unreserved, bare_label: true },
481    Keyword { name: "treat", token: token::TREAT, category: ColumnName, bare_label: true },
482    Keyword { name: "trigger", token: token::TRIGGER, category: Unreserved, bare_label: true },
483    Keyword { name: "trim", token: token::TRIM, category: ColumnName, bare_label: true },
484    Keyword { name: "true", token: token::TRUE_P, category: Reserved, bare_label: true },
485    Keyword { name: "truncate", token: token::TRUNCATE, category: Unreserved, bare_label: true },
486    Keyword { name: "trusted", token: token::TRUSTED, category: Unreserved, bare_label: true },
487    Keyword { name: "type", token: token::TYPE_P, category: Unreserved, bare_label: true },
488    Keyword { name: "types", token: token::TYPES_P, category: Unreserved, bare_label: true },
489    Keyword { name: "uescape", token: token::UESCAPE, category: Unreserved, bare_label: true },
490    Keyword { name: "unbounded", token: token::UNBOUNDED, category: Unreserved, bare_label: true },
491    Keyword { name: "uncommitted", token: token::UNCOMMITTED, category: Unreserved, bare_label: true },
492    Keyword { name: "unconditional", token: token::UNCONDITIONAL, category: Unreserved, bare_label: true },
493    Keyword { name: "unencrypted", token: token::UNENCRYPTED, category: Unreserved, bare_label: true },
494    Keyword { name: "union", token: token::UNION, category: Reserved, bare_label: false },
495    Keyword { name: "unique", token: token::UNIQUE, category: Reserved, bare_label: true },
496    Keyword { name: "unknown", token: token::UNKNOWN, category: Unreserved, bare_label: true },
497    Keyword { name: "unlisten", token: token::UNLISTEN, category: Unreserved, bare_label: true },
498    Keyword { name: "unlogged", token: token::UNLOGGED, category: Unreserved, bare_label: true },
499    Keyword { name: "until", token: token::UNTIL, category: Unreserved, bare_label: true },
500    Keyword { name: "update", token: token::UPDATE, category: Unreserved, bare_label: true },
501    Keyword { name: "user", token: token::USER, category: Reserved, bare_label: true },
502    Keyword { name: "using", token: token::USING, category: Reserved, bare_label: true },
503    Keyword { name: "vacuum", token: token::VACUUM, category: Unreserved, bare_label: true },
504    Keyword { name: "valid", token: token::VALID, category: Unreserved, bare_label: true },
505    Keyword { name: "validate", token: token::VALIDATE, category: Unreserved, bare_label: true },
506    Keyword { name: "validator", token: token::VALIDATOR, category: Unreserved, bare_label: true },
507    Keyword { name: "value", token: token::VALUE_P, category: Unreserved, bare_label: true },
508    Keyword { name: "values", token: token::VALUES, category: ColumnName, bare_label: true },
509    Keyword { name: "varchar", token: token::VARCHAR, category: ColumnName, bare_label: true },
510    Keyword { name: "variadic", token: token::VARIADIC, category: Reserved, bare_label: true },
511    Keyword { name: "varying", token: token::VARYING, category: Unreserved, bare_label: false },
512    Keyword { name: "verbose", token: token::VERBOSE, category: TypeFuncName, bare_label: true },
513    Keyword { name: "version", token: token::VERSION_P, category: Unreserved, bare_label: true },
514    Keyword { name: "view", token: token::VIEW, category: Unreserved, bare_label: true },
515    Keyword { name: "views", token: token::VIEWS, category: Unreserved, bare_label: true },
516    Keyword { name: "virtual", token: token::VIRTUAL, category: Unreserved, bare_label: true },
517    Keyword { name: "volatile", token: token::VOLATILE, category: Unreserved, bare_label: true },
518    Keyword { name: "wait", token: token::WAIT, category: Unreserved, bare_label: true },
519    Keyword { name: "when", token: token::WHEN, category: Reserved, bare_label: true },
520    Keyword { name: "where", token: token::WHERE, category: Reserved, bare_label: false },
521    Keyword { name: "whitespace", token: token::WHITESPACE_P, category: Unreserved, bare_label: true },
522    Keyword { name: "window", token: token::WINDOW, category: Reserved, bare_label: false },
523    Keyword { name: "with", token: token::WITH, category: Reserved, bare_label: false },
524    Keyword { name: "within", token: token::WITHIN, category: Unreserved, bare_label: false },
525    Keyword { name: "without", token: token::WITHOUT, category: Unreserved, bare_label: false },
526    Keyword { name: "work", token: token::WORK, category: Unreserved, bare_label: true },
527    Keyword { name: "wrapper", token: token::WRAPPER, category: Unreserved, bare_label: true },
528    Keyword { name: "write", token: token::WRITE, category: Unreserved, bare_label: true },
529    Keyword { name: "xml", token: token::XML_P, category: Unreserved, bare_label: true },
530    Keyword { name: "xmlattributes", token: token::XMLATTRIBUTES, category: ColumnName, bare_label: true },
531    Keyword { name: "xmlconcat", token: token::XMLCONCAT, category: ColumnName, bare_label: true },
532    Keyword { name: "xmlelement", token: token::XMLELEMENT, category: ColumnName, bare_label: true },
533    Keyword { name: "xmlexists", token: token::XMLEXISTS, category: ColumnName, bare_label: true },
534    Keyword { name: "xmlforest", token: token::XMLFOREST, category: ColumnName, bare_label: true },
535    Keyword { name: "xmlnamespaces", token: token::XMLNAMESPACES, category: ColumnName, bare_label: true },
536    Keyword { name: "xmlparse", token: token::XMLPARSE, category: ColumnName, bare_label: true },
537    Keyword { name: "xmlpi", token: token::XMLPI, category: ColumnName, bare_label: true },
538    Keyword { name: "xmlroot", token: token::XMLROOT, category: ColumnName, bare_label: true },
539    Keyword { name: "xmlserialize", token: token::XMLSERIALIZE, category: ColumnName, bare_label: true },
540    Keyword { name: "xmltable", token: token::XMLTABLE, category: ColumnName, bare_label: true },
541    Keyword { name: "year", token: token::YEAR_P, category: Unreserved, bare_label: false },
542    Keyword { name: "yes", token: token::YES_P, category: Unreserved, bare_label: true },
543    Keyword { name: "zone", token: token::ZONE, category: Unreserved, bare_label: true },
544];
545
546/// The displacement of each bucket.
547#[rustfmt::skip]
548pub(crate) static DISPLACEMENT: [u16; 256] = [
549    1, 0, 0, 0, 0, 2, 0, 0, 3, 0, 0, 3, 0, 0, 0, 0,
550    1, 1, 0, 0, 0, 2, 1, 2, 0, 3, 0, 0, 3, 0, 0, 0,
551    0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 2, 0, 3, 0, 0,
552    1, 2, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
553    2, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
554    1, 0, 0, 0, 0, 2, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0,
555    0, 2, 0, 4, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0,
556    3, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
557    0, 0, 0, 0, 0, 2, 0, 0, 1, 0, 1, 0, 1, 0, 1, 2,
558    0, 0, 0, 0, 3, 0, 2, 0, 0, 4, 0, 0, 0, 0, 0, 0,
559    1, 0, 0, 0, 3, 0, 0, 1, 0, 5, 2, 3, 0, 0, 0, 0,
560    0, 0, 1, 1, 4, 0, 1, 0, 2, 7, 1, 1, 0, 5, 1, 0,
561    1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
562    0, 4, 0, 0, 5, 0, 1, 0, 6, 0, 4, 9, 1, 1, 0, 0,
563    5, 0, 0, 4, 1, 1, 0, 0, 3, 2, 1, 1, 5, 0, 3, 0,
564    0, 1, 2, 0, 2, 0, 2, 0, 1, 4, 2, 0, 0, 3, 2, 3,
565];
566
567/// The keyword in each slot, from 1, or 0 for none.
568#[rustfmt::skip]
569pub(crate) static SLOTS: [u16; 1024] = [
570    367, 0, 418, 259, 23, 304, 0, 272, 11, 0, 0, 60, 0, 0, 202, 246,
571    0, 414, 0, 0, 0, 0, 0, 0, 63, 19, 0, 420, 0, 0, 0, 0,
572    495, 30, 42, 0, 0, 306, 0, 0, 156, 236, 0, 382, 476, 0, 0, 0,
573    0, 0, 157, 0, 0, 228, 77, 0, 0, 325, 0, 208, 21, 0, 222, 69,
574    0, 0, 494, 0, 0, 399, 102, 0, 0, 492, 0, 279, 392, 0, 61, 0,
575    0, 244, 0, 0, 0, 242, 0, 25, 0, 149, 0, 0, 451, 0, 0, 493,
576    0, 0, 217, 53, 371, 0, 473, 57, 0, 0, 0, 480, 0, 195, 158, 0,
577    0, 270, 0, 121, 72, 0, 0, 0, 375, 487, 0, 179, 0, 169, 0, 245,
578    0, 0, 0, 249, 0, 27, 481, 0, 296, 341, 0, 0, 0, 0, 458, 478,
579    426, 445, 166, 116, 0, 0, 0, 0, 0, 123, 159, 346, 0, 142, 396, 363,
580    0, 0, 423, 329, 460, 0, 477, 0, 361, 0, 0, 0, 302, 247, 0, 0,
581    230, 0, 0, 0, 138, 235, 15, 0, 0, 0, 206, 405, 4, 252, 449, 275,
582    194, 92, 0, 0, 207, 415, 390, 0, 0, 74, 0, 0, 0, 431, 301, 0,
583    0, 219, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 411, 0, 0,
584    65, 0, 0, 0, 0, 0, 178, 0, 0, 223, 0, 20, 283, 0, 203, 83,
585    0, 0, 0, 0, 143, 0, 113, 317, 358, 0, 0, 0, 457, 108, 0, 0,
586    0, 0, 425, 0, 347, 0, 59, 58, 0, 0, 0, 416, 79, 401, 498, 0,
587    0, 471, 0, 0, 278, 0, 289, 0, 0, 0, 324, 0, 196, 155, 0, 220,
588    264, 0, 225, 0, 384, 0, 0, 0, 474, 0, 0, 0, 335, 0, 292, 165,
589    0, 469, 0, 465, 0, 118, 0, 16, 0, 214, 0, 0, 0, 456, 32, 0,
590    0, 0, 0, 0, 0, 453, 0, 499, 0, 55, 5, 280, 199, 120, 387, 0,
591    176, 0, 0, 0, 314, 0, 0, 0, 0, 175, 0, 0, 0, 254, 182, 326,
592    435, 0, 84, 89, 0, 268, 0, 0, 374, 408, 171, 210, 0, 0, 13, 0,
593    0, 295, 0, 184, 0, 88, 229, 0, 0, 0, 0, 322, 241, 0, 0, 300,
594    0, 0, 440, 133, 0, 323, 0, 299, 0, 0, 0, 172, 0, 0, 212, 0,
595    0, 0, 130, 0, 0, 105, 443, 0, 355, 0, 26, 0, 0, 0, 309, 463,
596    201, 0, 0, 339, 0, 0, 0, 0, 257, 313, 0, 0, 0, 0, 397, 0,
597    0, 393, 0, 234, 0, 66, 321, 0, 0, 424, 0, 0, 439, 0, 0, 124,
598    75, 162, 0, 0, 128, 256, 455, 93, 0, 316, 0, 0, 0, 0, 386, 0,
599    0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 104, 0, 378, 312,
600    0, 0, 0, 0, 22, 404, 129, 0, 233, 0, 0, 0, 78, 472, 0, 0,
601    0, 475, 0, 37, 0, 0, 191, 0, 441, 288, 0, 0, 127, 0, 285, 402,
602    0, 0, 448, 348, 0, 308, 1, 160, 434, 291, 428, 39, 41, 442, 0, 0,
603    366, 491, 0, 0, 227, 0, 0, 213, 12, 281, 0, 0, 34, 0, 320, 0,
604    0, 193, 0, 421, 109, 71, 28, 0, 0, 318, 0, 0, 0, 0, 0, 232,
605    0, 0, 0, 46, 0, 45, 0, 0, 0, 0, 96, 147, 357, 99, 0, 139,
606    122, 0, 0, 80, 251, 67, 218, 0, 464, 44, 0, 0, 350, 0, 0, 250,
607    290, 0, 0, 98, 95, 0, 18, 52, 0, 137, 417, 0, 394, 0, 0, 0,
608    177, 0, 273, 0, 0, 354, 100, 0, 0, 154, 388, 0, 0, 0, 400, 0,
609    224, 0, 48, 0, 0, 0, 0, 0, 298, 168, 372, 0, 0, 38, 352, 0,
610    135, 0, 303, 31, 0, 0, 36, 419, 0, 0, 0, 319, 141, 0, 353, 81,
611    0, 0, 260, 239, 125, 0, 14, 0, 0, 0, 486, 186, 0, 56, 0, 490,
612    0, 114, 215, 0, 0, 0, 0, 51, 0, 0, 47, 315, 0, 0, 338, 436,
613    0, 0, 173, 183, 0, 211, 0, 381, 0, 0, 489, 0, 0, 0, 0, 248,
614    17, 146, 437, 0, 370, 0, 190, 0, 0, 0, 433, 0, 188, 0, 422, 395,
615    0, 276, 0, 0, 0, 0, 0, 0, 294, 0, 403, 164, 444, 253, 0, 106,
616    274, 163, 488, 343, 0, 0, 0, 0, 153, 0, 35, 0, 0, 406, 0, 0,
617    54, 0, 497, 62, 340, 68, 336, 0, 412, 205, 0, 429, 332, 484, 0, 226,
618    144, 0, 376, 0, 181, 49, 446, 0, 231, 0, 307, 189, 0, 0, 485, 0,
619    0, 461, 334, 0, 132, 0, 409, 0, 351, 432, 282, 413, 24, 221, 450, 452,
620    344, 150, 328, 0, 0, 293, 0, 0, 0, 0, 0, 349, 8, 0, 0, 337,
621    0, 0, 197, 10, 269, 107, 0, 0, 0, 0, 0, 9, 0, 50, 0, 82,
622    192, 255, 0, 368, 6, 0, 0, 263, 454, 0, 0, 359, 0, 151, 91, 174,
623    0, 310, 0, 398, 0, 70, 185, 94, 410, 0, 0, 362, 391, 152, 0, 0,
624    0, 237, 0, 0, 148, 0, 0, 0, 287, 76, 430, 0, 187, 0, 0, 97,
625    379, 216, 3, 483, 496, 427, 145, 73, 0, 103, 238, 467, 240, 470, 389, 90,
626    243, 87, 0, 0, 0, 0, 0, 356, 482, 466, 101, 134, 0, 0, 297, 0,
627    0, 331, 0, 170, 0, 305, 0, 161, 0, 0, 286, 468, 0, 0, 330, 126,
628    33, 0, 311, 0, 342, 136, 119, 198, 277, 0, 115, 0, 131, 0, 0, 364,
629    0, 112, 40, 261, 0, 265, 0, 209, 380, 0, 140, 200, 117, 0, 479, 262,
630    29, 258, 2, 0, 0, 0, 0, 0, 0, 327, 333, 0, 0, 0, 369, 267,
631    0, 86, 407, 360, 0, 271, 0, 0, 385, 0, 0, 0, 462, 0, 365, 0,
632    0, 0, 383, 7, 266, 0, 0, 373, 0, 459, 345, 0, 0, 85, 0, 377,
633    0, 447, 0, 0, 167, 0, 180, 0, 438, 111, 110, 284, 0, 0, 204, 0,
634];
635
636/// The hash of a word, with ASCII letters folded to lower case, as PostgreSQL folds a keyword.
637const fn hash(word: &[u8]) -> u32 {
638    let mut h: u32 = 0x811c_9dc5;
639    let mut at = 0;
640    while at < word.len() {
641        h ^= word[at].to_ascii_lowercase() as u32;
642        h = h.wrapping_mul(0x0100_0193);
643        at += 1;
644    }
645    h
646}
647
648/// The keyword that a word spells, with ASCII letters in any case, or `None`.
649pub(crate) fn lookup(word: &[u8]) -> Option<&'static Keyword> {
650    if word.len() > LONGEST {
651        return None;
652    }
653    let h = hash(word);
654    let d = u32::from(DISPLACEMENT[(h % BUCKETS) as usize]);
655    let mut x = h ^ d.wrapping_mul(0x9e37_79b9);
656    x ^= x >> 16;
657    x = x.wrapping_mul(0x85eb_ca6b);
658    x ^= x >> 13;
659    x = x.wrapping_mul(0xc2b2_ae35);
660    x ^= x >> 16;
661    let index = SLOTS[(x >> (32 - SLOT_BITS)) as usize];
662    if index == 0 {
663        return None;
664    }
665    let keyword = &KEYWORDS[usize::from(index) - 1];
666    keyword.name.as_bytes().eq_ignore_ascii_case(word).then_some(keyword)
667}