Skip to content

Redshift Keyword Compatibility Reference

Generated for GSP Java version 4.1.0.7 on 2026-03-13

This page was generated using hybrid static extraction from parser source files combined with runtime validation against the actual GSP parser. Re-run the extraction script after parser updates to keep this page current.

Keywords That AWS Allows but GSP Restricts

The following 6 keywords can be used as unquoted column names in AWS Redshift (they are not on the AWS reserved words list), but the GSP parser currently restricts their use:

Keyword GSP Behavior Example That Fails Workaround
LISTAGG Blocked — fails in all contexts SELECT listagg FROM t SELECT "listagg" FROM t
APPROXIMATE Context-specific — fails unqualified SELECT approximate FROM t SELECT t.approximate FROM t or SELECT "approximate" FROM t
CHARACTER Context-specific — fails unqualified SELECT character FROM t SELECT t.character FROM t or SELECT "character" FROM t
CONNECT_BY_ROOT Context-specific — fails unqualified SELECT connect_by_root FROM t SELECT t.connect_by_root FROM t or SELECT "connect_by_root" FROM t
CONVERT Context-specific — fails unqualified SELECT convert FROM t SELECT t.convert FROM t or SELECT "convert" FROM t
DOUBLE Context-specific — fails unqualified SELECT double FROM t SELECT t.double FROM t or SELECT "double" FROM t

"Context-specific" means SELECT keyword FROM t fails but SELECT t.keyword FROM t succeeds. The parser misinterprets the bare keyword as part of SQL syntax rather than a column name.

These 6 keywords are candidates for future grammar relaxation. If you encounter issues with any of them, use the workarounds above or report through your support channel.


Full Classification Overview

Out of 488 keywords recognized by the GSP Redshift parser:

Classification Count Description
Allowed 457 Can be used as an unquoted column name in both canonical contexts
Context-specific 29 Fails as SELECT keyword FROM t but works as SELECT t.keyword FROM t
Blocked 2 Cannot be used as an unquoted column name in either context

Of the 29 context-specific and 2 blocked keywords, 25 are also reserved by AWS Redshift — so they would cause issues in AWS Redshift as well. Only the 6 keywords listed above represent a gap between GSP and AWS behavior.

Context-Specific Keywords (Full List)

These keywords fail when used as bare column names (SELECT keyword FROM t) but succeed when table-qualified (SELECT t.keyword FROM t).

Keyword Also Reserved by AWS? Reason
ALL Yes SELECT qualifier (SELECT ALL)
APPROXIMATE No Parsed as APPROXIMATE COUNT syntax
ARRAY Yes Type/expression keyword
AUTHORIZATION Yes Privilege keyword
BINARY Yes Type keyword
CASE Yes Starts CASE expression
CAST Yes Starts CAST expression
CHARACTER No Type keyword
CONNECT_BY_ROOT No Hierarchical query keyword
CONVERT No Starts CONVERT expression
CROSS Yes JOIN keyword
DISTINCT Yes SELECT qualifier
DOUBLE No Type keyword (DOUBLE PRECISION)
FREEZE Yes Join keyword
FULL Yes JOIN keyword
ILIKE Yes Operator keyword
INNER Yes JOIN keyword
INTO Yes SELECT INTO keyword
IS Yes Operator keyword
JOIN Yes JOIN keyword
LEFT Yes JOIN keyword
LIKE Yes Operator keyword
NATURAL Yes JOIN keyword
OUTER Yes JOIN keyword
OVERLAPS Yes Operator keyword
RIGHT Yes JOIN keyword
SIMILAR Yes Operator keyword
TOP Yes SELECT TOP N clause
VERBOSE Yes Modifier keyword

Blocked Keywords (Full List)

Keyword Also Reserved by AWS? Workaround
FROM Yes SELECT "FROM" FROM t
LISTAGG No SELECT "LISTAGG" FROM t

The POSITION Keyword

The POSITION keyword is a notable dual-use case. Following a customer-reported bug (MantisBT #4360), it was moved from collabel_reserved_keyword to keyword_canbe_column_name, allowing it to function both as:

  • A column name: SELECT position FROM t
  • A function: SELECT POSITION('a' IN 'abc') FROM t

Both uses parse correctly in the current version.

Workaround: Double-Quoted Identifiers

For any keyword that fails as an unquoted column name, you can use double-quoted identifiers:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
-- Blocked keyword as column name: fails
SELECT listagg FROM t;

-- Workaround: quote the identifier
SELECT "listagg" FROM t;

-- Context-specific keyword: fails unqualified
SELECT convert FROM t;

-- Workarounds
SELECT t.convert FROM t;  -- table-qualified
SELECT "convert" FROM t;  -- double-quoted

Double-quoted identifiers have been verified to work for all blocked and context-specific keywords listed on this page.

Scope and Limitations

  • Tested contexts: SELECT keyword FROM t and SELECT t.keyword FROM t. Other contexts (DDL column definitions, INSERT column lists, aliases) may behave differently.
  • Version-specific: This report reflects GSP Java version 4.1.0.7.
  • AWS comparison: Based on the AWS Redshift reserved words list dated 2023-05-08. AWS may have updated their list since.
  • Case sensitivity: Keywords are case-insensitive. select, SELECT, and Select are all treated the same.

How to Report Discrepancies

If you encounter a keyword that behaves differently from what this page describes, please report it through your support channel. Include:

  1. The exact SQL statement
  2. The GSP parser version
  3. Whether the same SQL works in Amazon Redshift

Methodology

  1. Static extraction: A Python script parses the lexer (.cod) and grammar (.y) source files to identify all 488 keywords and their grammar classifications.
  2. Runtime validation: A Java test harness validates every classification against actual TGSqlParser runtime behavior.
  3. AWS comparison: The runtime-verified GSP classifications are compared against the AWS Redshift reserved words list to identify gaps.
  4. JSON dataset: The authoritative data is stored in docs/generated/redshift_keyword_compatibility.json.