Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing SQL keywords in DatabaseMetaData.getSQLKeywords #121

Open
YotillaAntoni opened this issue Jul 2, 2024 · 0 comments
Open

Missing SQL keywords in DatabaseMetaData.getSQLKeywords #121

YotillaAntoni opened this issue Jul 2, 2024 · 0 comments

Comments

@YotillaAntoni
Copy link

Driver version

2.1.0.29

Redshift version

PostgreSQL 8.0.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3), Redshift 1.0.69945�

Client Operating System

macOS 14.5

JAVA/JVM version

17.0.9

Problem description

The method DatabaseMetaData.getSQLKeywords doesn't return all the reserved keywords for Redshift.
According to the JDBC spec this method should return:

a comma-separated list of all of this database's SQL keywords that are NOT also SQL:2003 keywords.

The method, implemented in com.amazon.redshift.jdbc.RedshiftDatabaseMetaData returns the following list:

abort,access,aggregate,also,analyse,analyze,backward,bit,cache,checkpoint,class,
cluster,comment,concurrently,connection,conversion,copy,csv,database,delimiter,
delimiters,disable,do,enable,encoding,encrypted,exclusive,explain,force,forward,freeze,
greatest,handler,header,if,ilike,immutable,implicit,index,indexes,inherit,inherits,
instead,isnull,least,limit,listen,load,location,lock,mode,move,nothing,notify,notnull,
nowait,off,offset,oids,operator,owned,owner,password,prepared,procedural,quote,reassign,
recheck,reindex,rename,replace,reset,restrict,returning,rule,setof,share,show,stable,
statistics,stdin,stdout,storage,strict,sysid,tablespace,temp,template,truncate,trusted,
unencrypted,unlisten,until,vacuum,valid,validator,verbose,volatile

But the list doesn't contain all the reserved words specified in https://docs.aws.amazon.com/redshift/latest/dg/r_pg_keywords.html

For example, aes128 or aes256 are not included, they are not part of SQL 2003 keywords, and they are reserved keywords, as they must be quoted.

JDBC trace logs

Reproduction code

@YotillaAntoni YotillaAntoni changed the title Missing SQL keywords in DatabaseMetaData.getSQLKeywords` Missing SQL keywords in DatabaseMetaData.getSQLKeywords Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant