Please take this survey to help us learn more about how you use third party tools. Your input is greatly appreciated!

SQL Reserved Words

Jim Knicely authored this tip.

Keywords are words that have a specific meaning in the SQL language. Every SQL statement contains one or more keywords. Many keywords are also reserved words. Vertica recommends that you not use reserved words as names for objects, or as identifiers. Including reserved words can make your SQL statements confusing.

You can query the V_CATALOG.STANDARD_KEYWORDS system table to find the list of Vertica SQL reserved words.


dbadmin=> SELECT *FROM v_catalog.standard_keywords WHERE reserved = 'R' ORDER BY standard_version DESC LIMIT 1;
 keyword | standard_version | reserved
ABS     |             2011 | R
(1 row)

Notice how the number of reserved words increases by ANSI SQL version:

dbadmin=> SELECT standard_version, COUNT(*) reserved_word_cnt FROM v_catalog.standard_keywords WHERE reserved = 'R' GROUP BY standard_version ORDER BY 1;
 standard_version | reserved_word_cnt
              1992 |               227
              2003 |               288
              2008 |               298
              2011 |               357
(4 rows)

Have Fun!

Sign In or Register to comment.

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.