-
Notifications
You must be signed in to change notification settings - Fork 33
quote_ident - actual C definition #238
Open
Description
Our Code
pgsql-parser/packages/deparser/src/deparser.ts
Lines 2460 to 2483 in bf4612f
private static readonly RESERVED_WORDS = new Set([
'all', 'analyse', 'analyze', 'and', 'any', 'array', 'as', 'asc', 'asymmetric', 'both',
'case', 'cast', 'check', 'collate', 'column', 'constraint', 'create', 'current_catalog',
'current_date', 'current_role', 'current_time', 'current_timestamp', 'current_user',
'default', 'deferrable', 'desc', 'distinct', 'do', 'else', 'end', 'except', 'false',
'fetch', 'for', 'foreign', 'from', 'grant', 'group', 'having', 'in', 'initially',
'intersect', 'into', 'lateral', 'leading', 'limit', 'localtime', 'localtimestamp',
'not', 'null', 'offset', 'on', 'only', 'or', 'order', 'placing', 'primary',
'references', 'returning', 'select', 'session_user', 'some', 'symmetric', 'table',
'then', 'to', 'trailing', 'true', 'union', 'unique', 'user', 'using', 'variadic',
'when', 'where', 'window', 'with'
]);
private static needsQuotes(value: string): boolean {
if (!value) return false;
const needsQuotesRegex = /[a-z]+[\W\w]*[A-Z]+|[A-Z]+[\W\w]*[a-z]+|\W/;
const isAllUppercase = /^[A-Z]+$/.test(value);
return needsQuotesRegex.test(value) ||
Deparser.RESERVED_WORDS.has(value.toLowerCase()) ||
isAllUppercase;
}
PG Source
doxygen
https://doxygen.postgresql.org/ruleutils_8c.html#a8c18b3ffb8863e7740b32ef5f4c05ddc
and keywords too
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.