]> granicus.if.org Git - postgresql/blobdiff - src/backend/parser/keywords.c
Implement SQL92-compatible FIRST, LAST, ABSOLUTE n, RELATIVE n options
[postgresql] / src / backend / parser / keywords.c
index 39d5ccbb5e0e8de49257479eed1274e8bd262b2f..49432cb957a83f0a44dc0843d6356037bc253ca1 100644 (file)
@@ -3,12 +3,12 @@
  * keywords.c
  *       lexical token lookup for reserved words in PostgreSQL
  *
- * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.108 2002/05/02 18:44:10 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.135 2003/03/11 19:40:23 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -20,6 +20,8 @@
 #include "parser/keywords.h"
 #include "parser/parse.h"
 
+/* NB: This file is also used by pg_dump. */
+
 /*
  * List of (keyword-name, keyword-token-value) pairs.
  *
@@ -28,7 +30,7 @@
  */
 static const ScanKeyword ScanKeywords[] = {
        /* name, value */
-       {"abort", ABORT_TRANS},
+       {"abort", ABORT_P},
        {"absolute", ABSOLUTE},
        {"access", ACCESS},
        {"action", ACTION},
@@ -44,26 +46,31 @@ static const ScanKeyword ScanKeywords[] = {
        {"as", AS},
        {"asc", ASC},
        {"assertion", ASSERTION},
+       {"assignment", ASSIGNMENT},
        {"at", AT},
        {"authorization", AUTHORIZATION},
        {"backward", BACKWARD},
        {"before", BEFORE},
-       {"begin", BEGIN_TRANS},
+       {"begin", BEGIN_P},
        {"between", BETWEEN},
+       {"bigint", BIGINT},
        {"binary", BINARY},
        {"bit", BIT},
+       {"boolean", BOOLEAN},
        {"both", BOTH},
        {"by", BY},
        {"cache", CACHE},
+       {"called", CALLED},
        {"cascade", CASCADE},
        {"case", CASE},
        {"cast", CAST},
        {"chain", CHAIN},
-       {"char", CHAR},
+       {"char", CHAR_P},
        {"character", CHARACTER},
        {"characteristics", CHARACTERISTICS},
        {"check", CHECK},
        {"checkpoint", CHECKPOINT},
+       {"class", CLASS},
        {"close", CLOSE},
        {"cluster", CLUSTER},
        {"coalesce", COALESCE},
@@ -74,6 +81,8 @@ static const ScanKeyword ScanKeywords[] = {
        {"committed", COMMITTED},
        {"constraint", CONSTRAINT},
        {"constraints", CONSTRAINTS},
+       {"conversion", CONVERSION_P},
+       {"convert", CONVERT},
        {"copy", COPY},
        {"create", CREATE},
        {"createdb", CREATEDB},
@@ -87,13 +96,16 @@ static const ScanKeyword ScanKeywords[] = {
        {"cycle", CYCLE},
        {"database", DATABASE},
        {"day", DAY_P},
+       {"deallocate", DEALLOCATE},
        {"dec", DEC},
        {"decimal", DECIMAL},
        {"declare", DECLARE},
        {"default", DEFAULT},
        {"deferrable", DEFERRABLE},
        {"deferred", DEFERRED},
-       {"delete", DELETE},
+       {"definer", DEFINER},
+       {"delete", DELETE_P},
+       {"delimiter", DELIMITER},
        {"delimiters", DELIMITERS},
        {"desc", DESC},
        {"distinct", DISTINCT},
@@ -105,17 +117,19 @@ static const ScanKeyword ScanKeywords[] = {
        {"else", ELSE},
        {"encoding", ENCODING},
        {"encrypted", ENCRYPTED},
-       {"end", END_TRANS},
+       {"end", END_P},
        {"escape", ESCAPE},
        {"except", EXCEPT},
        {"exclusive", EXCLUSIVE},
        {"execute", EXECUTE},
        {"exists", EXISTS},
        {"explain", EXPLAIN},
+       {"external", EXTERNAL},
        {"extract", EXTRACT},
        {"false", FALSE_P},
        {"fetch", FETCH},
-       {"float", FLOAT},
+       {"first", FIRST_P},
+       {"float", FLOAT_P},
        {"for", FOR},
        {"force", FORCE},
        {"foreign", FOREIGN},
@@ -126,25 +140,31 @@ static const ScanKeyword ScanKeywords[] = {
        {"function", FUNCTION},
        {"global", GLOBAL},
        {"grant", GRANT},
-       {"group", GROUP},
+       {"group", GROUP_P},
        {"handler", HANDLER},
        {"having", HAVING},
        {"hour", HOUR_P},
        {"ilike", ILIKE},
        {"immediate", IMMEDIATE},
-       {"in", IN},
+       {"immutable", IMMUTABLE},
+       {"implicit", IMPLICIT_P},
+       {"in", IN_P},
        {"increment", INCREMENT},
        {"index", INDEX},
        {"inherits", INHERITS},
        {"initially", INITIALLY},
        {"inner", INNER_P},
        {"inout", INOUT},
+       {"input", INPUT},
        {"insensitive", INSENSITIVE},
        {"insert", INSERT},
        {"instead", INSTEAD},
+       {"int", INT},
+       {"integer", INTEGER},
        {"intersect", INTERSECT},
        {"interval", INTERVAL},
        {"into", INTO},
+       {"invoker", INVOKER},
        {"is", IS},
        {"isnull", ISNULL},
        {"isolation", ISOLATION},
@@ -152,6 +172,7 @@ static const ScanKeyword ScanKeywords[] = {
        {"key", KEY},
        {"lancompiler", LANCOMPILER},
        {"language", LANGUAGE},
+       {"last", LAST_P},
        {"leading", LEADING},
        {"left", LEFT},
        {"level", LEVEL},
@@ -160,6 +181,8 @@ static const ScanKeyword ScanKeywords[] = {
        {"listen", LISTEN},
        {"load", LOAD},
        {"local", LOCAL},
+       {"localtime", LOCALTIME},
+       {"localtimestamp", LOCALTIMESTAMP},
        {"location", LOCATION},
        {"lock", LOCK_P},
        {"match", MATCH},
@@ -197,22 +220,28 @@ static const ScanKeyword ScanKeywords[] = {
        {"option", OPTION},
        {"or", OR},
        {"order", ORDER},
-       {"out", OUT},
+       {"out", OUT_P},
        {"outer", OUTER_P},
        {"overlaps", OVERLAPS},
+       {"overlay", OVERLAY},
        {"owner", OWNER},
        {"partial", PARTIAL},
        {"password", PASSWORD},
        {"path", PATH_P},
        {"pendant", PENDANT},
+       {"placing", PLACING},
        {"position", POSITION},
        {"precision", PRECISION},
+       {"prepare", PREPARE},
+       {"preserve", PRESERVE},
        {"primary", PRIMARY},
        {"prior", PRIOR},
        {"privileges", PRIVILEGES},
        {"procedural", PROCEDURAL},
        {"procedure", PROCEDURE},
        {"read", READ},
+       {"real", REAL},
+       {"recheck", RECHECK},
        {"references", REFERENCES},
        {"reindex", REINDEX},
        {"relative", RELATIVE},
@@ -225,10 +254,12 @@ static const ScanKeyword ScanKeywords[] = {
        {"right", RIGHT},
        {"rollback", ROLLBACK},
        {"row", ROW},
+       {"rows", ROWS},
        {"rule", RULE},
        {"schema", SCHEMA},
        {"scroll", SCROLL},
        {"second", SECOND_P},
+       {"security", SECURITY},
        {"select", SELECT},
        {"sequence", SEQUENCE},
        {"serializable", SERIALIZABLE},
@@ -238,13 +269,18 @@ static const ScanKeyword ScanKeywords[] = {
        {"setof", SETOF},
        {"share", SHARE},
        {"show", SHOW},
+       {"similar", SIMILAR},
+       {"simple", SIMPLE},
+       {"smallint", SMALLINT},
        {"some", SOME},
+       {"stable", STABLE},
        {"start", START},
        {"statement", STATEMENT},
        {"statistics", STATISTICS},
        {"stdin", STDIN},
        {"stdout", STDOUT},
        {"storage", STORAGE},
+       {"strict", STRICT},
        {"substring", SUBSTRING},
        {"sysid", SYSID},
        {"table", TABLE},
@@ -258,6 +294,7 @@ static const ScanKeyword ScanKeywords[] = {
        {"toast", TOAST},
        {"trailing", TRAILING},
        {"transaction", TRANSACTION},
+       {"treat", TREAT},
        {"trigger", TRIGGER},
        {"trim", TRIM},
        {"true", TRUE_P},
@@ -276,17 +313,20 @@ static const ScanKeyword ScanKeywords[] = {
        {"using", USING},
        {"vacuum", VACUUM},
        {"valid", VALID},
+       {"validator", VALIDATOR},
        {"values", VALUES},
        {"varchar", VARCHAR},
        {"varying", VARYING},
        {"verbose", VERBOSE},
        {"version", VERSION},
        {"view", VIEW},
+       {"volatile", VOLATILE},
        {"when", WHEN},
        {"where", WHERE},
        {"with", WITH},
        {"without", WITHOUT},
        {"work", WORK},
+       {"write", WRITE},
        {"year", YEAR_P},
        {"zone", ZONE},
 };