RT# 80898 - added config option to allow for the changing of the name for credit...
[freeside.git] / etc / sql-reserved-words.txt
1 The data below is wrong/incomplete, see:
2 PG8.3 - http://www.postgresql.org/docs/8.3/static/sql-keywords-appendix.html
3 MySQL5.6 - http://dev.mysql.com/doc/refman/5.6/en/reserved-words.html
4 -------------------------------------------------------------------------------
5
6
7 From http://epoch.cs.berkeley.edu:8000/sequoia/dba/montage/FAQ/SQL.html
8   by Jean Anderson (jta@postgres.berkeley.edu)
9
10 What are the SQL reserved words? 
11
12 I grep'd the following list out of the sql docs available via anonymous ftp to speckle.ncsl.nist.gov:/isowg3.
13 SQL3 words are not set in stone, but you'd do well to avoid them. 
14
15     From sql1992.txt:
16
17          AFTER, ALIAS, ASYNC, BEFORE, BOOLEAN, BREADTH,
18          COMPLETION, CALL, CYCLE, DATA, DEPTH, DICTIONARY, EACH, ELSEIF,
19          EQUALS, GENERAL, IF, IGNORE, LEAVE, LESS, LIMIT, LOOP, MODIFY,
20          NEW, NONE, OBJECT, OFF, OID, OLD, OPERATION, OPERATORS, OTHERS,
21          PARAMETERS, PENDANT, PREORDER, PRIVATE, PROTECTED, RECURSIVE, REF,
22          REFERENCING, REPLACE, RESIGNAL, RETURN, RETURNS, ROLE, ROUTINE,
23          ROW, SAVEPOINT, SEARCH, SENSITIVE, SEQUENCE, SIGNAL, SIMILAR,
24          SQLEXCEPTION, SQLWARNING, STRUCTURE, TEST, THERE, TRIGGER, TYPE,
25          UNDER, VARIABLE, VIRTUAL, VISIBLE, WAIT, WHILE, WITHOUT
26
27     From sql1992.txt (Annex E):
28
29          ABSOLUTE, ACTION, ADD, ALLOCATE, ALTER, ARE, ASSERTION, AT, BETWEEN,
30          BIT, BIT
31
32 What are the SQL reserved words? 
33
34 I grep'd the following list out of the sql docs available via anonymous ftp to speckle.ncsl.nist.gov:/isowg3.
35 SQL3 words are not set in stone, but you'd do well to avoid them. 
36
37     From sql1992.txt:
38
39          AFTER, ALIAS, ASYNC, BEFORE, BOOLEAN, BREADTH,
40          COMPLETION, CALL, CYCLE, DATA, DEPTH, DICTIONARY, EACH, ELSEIF,
41          EQUALS, GENERAL, IF, IGNORE, LEAVE, LESS, LIMIT, LOOP, MODIFY,
42          NEW, NONE, OBJECT, OFF, OID, OLD, OPERATION, OPERATORS, OTHERS,
43          PARAMETERS, PENDANT, PREORDER, PRIVATE, PROTECTED, RECURSIVE, REF,
44          REFERENCING, REPLACE, RESIGNAL, RETURN, RETURNS, ROLE, ROUTINE,
45          ROW, SAVEPOINT, SEARCH, SENSITIVE, SEQUENCE, SIGNAL, SIMILAR,
46          SQLEXCEPTION, SQLWARNING, STRUCTURE, TEST, THERE, TRIGGER, TYPE,
47          UNDER, VARIABLE, VIRTUAL, VISIBLE, WAIT, WHILE, WITHOUT
48
49     From sql1992.txt (Annex E):
50
51          ABSOLUTE, ACTION, ADD, ALLOCATE, ALTER, ARE, ASSERTION, AT, BETWEEN,
52          BIT, BIT
53
54 What are the SQL reserved words? 
55
56 I grep'd the following list out of the sql docs available via anonymous ftp to speckle.ncsl.nist.gov:/isowg3.
57 SQL3 words are not set in stone, but you'd do well to avoid them. 
58
59     From sql1992.txt:
60
61          AFTER, ALIAS, ASYNC, BEFORE, BOOLEAN, BREADTH,
62          COMPLETION, CALL, CYCLE, DATA, DEPTH, DICTIONARY, EACH, ELSEIF,
63          EQUALS, GENERAL, IF, IGNORE, LEAVE, LESS, LIMIT, LOOP, MODIFY,
64          NEW, NONE, OBJECT, OFF, OID, OLD, OPERATION, OPERATORS, OTHERS,
65          PARAMETERS, PENDANT, PREORDER, PRIVATE, PROTECTED, RECURSIVE, REF,
66          REFERENCING, REPLACE, RESIGNAL, RETURN, RETURNS, ROLE, ROUTINE,
67          ROW, SAVEPOINT, SEARCH, SENSITIVE, SEQUENCE, SIGNAL, SIMILAR,
68          SQLEXCEPTION, SQLWARNING, STRUCTURE, TEST, THERE, TRIGGER, TYPE,
69          UNDER, VARIABLE, VIRTUAL, VISIBLE, WAIT, WHILE, WITHOUT
70
71     From sql1992.txt (Annex E):
72
73          ABSOLUTE, ACTION, ADD, ALLOCATE, ALTER, ARE, ASSERTION, AT, BETWEEN,
74          BIT, BIT_LENGTH, BOTH, CASCADE, CASCADED, CASE, CAST, CATALOG,
75          CHAR_LENGTH, CHARACTER_LENGTH, COALESCE, COLLATE, COLLATION, COLUMN,
76          CONNECT, CONNECTION, CONSTRAINT, CONSTRAINTS, CONVERT, CORRESPONDING,
77          CROSS, CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP, CURRENT_USER,
78          DATE, DAY, DEALLOCATE, DEFERRABLE, DEFERRED, DESCRIBE, DESCRIPTOR,
79          DIAGNOSTICS, DISCONNECT, DOMAIN, DROP, ELSE, END-EXEC, EXCEPT,
80          EXCEPTION, EXECUTE, EXTERNAL, EXTRACT, FALSE, FIRST, FULL, GET,
81          GLOBAL, HOUR, IDENTITY, IMMEDIATE, INITIALLY, INNER, INPUT,
82          INSENSITIVE, INTERSECT, INTERVAL, ISOLATION, JOIN, LAST, LEADING,
83          LEFT, LEVEL, LOCAL, LOWER, MATCH, MINUTE, MONTH, NAMES, NATIONAL,
84          NATURAL, NCHAR, NEXT, NO, NULLIF, OCTET_LENGTH, ONLY, OUTER, OUTPUT,
85          OVERLAPS, PAD, PARTIAL, POSITION, PREPARE, PRESERVE, PRIOR, READ,
86          RELATIVE, RESTRICT, REVOKE, RIGHT, ROWS, SCROLL, SECOND, SESSION,
87          SESSION_USER, SIZE, SPACE, SQLSTATE, SUBSTRING, SYSTEM_USER,
88          TEMPORARY, THEN, TIME, TIMESTAMP, TIMEZONE_HOUR, TIMEZONE_MINUTE,
89          TRAILING, TRANSACTION, TRANSLATE, TRANSLATION, TRIM, TRUE, UNKNOWN,
90          UPPER, USAGE, USING, VALUE, VARCHAR, VARYING, WHEN, WRITE, YEAR, ZONE
91
92     From sql3part2.txt (Annex E)
93
94          ACTION, ACTOR, AFTER, ALIAS, ASYNC, ATTRIBUTES, BEFORE, BOOLEAN,
95          BREADTH, COMPLETION, CURRENT_PATH, CYCLE, DATA, DEPTH, DESTROY,
96          DICTIONARY, EACH, ELEMENT, ELSEIF, EQUALS, FACTOR, GENERAL, HOLD,
97          IGNORE, INSTEAD, LESS, LIMIT, LIST, MODIFY, NEW, NEW_TABLE, NO,
98          NONE, OFF, OID, OLD, OLD_TABLE, OPERATION, OPERATOR, OPERATORS,
99          PARAMETERS, PATH, PENDANT, POSTFIX, PREFIX, PREORDER, PRIVATE,
100          PROTECTED, RECURSIVE, REFERENCING, REPLACE, ROLE, ROUTINE, ROW,
101          SAVEPOINT, SEARCH, SENSITIVE, SEQUENCE, SESSION, SIMILAR, SPACE,
102          SQLEXCEPTION, SQLWARNING, START, STATE, STRUCTURE, SYMBOL, TERM,
103          TEST, THERE, TRIGGER, TYPE, UNDER, VARIABLE, VIRTUAL, VISIBLE,
104          WAIT, WITHOUT
105
106     sql3part4.txt (ANNEX E):
107
108          CALL, DO, ELSEIF, EXCEPTION, IF, LEAVE, LOOP, OTHERS, RESIGNAL,
109          RETURN, RETURNS, SIGNAL, TUPLE, WHILE
110
111 from http://dev.mysql.com/doc/refman/5.6/en/reserved-words.html
112
113 ACCESSIBLE      ADD     ALL
114 ALTER   ANALYZE         AND
115 AS      ASC     ASENSITIVE
116 BEFORE  BETWEEN         BIGINT
117 BINARY  BLOB    BOTH
118 BY      CALL    CASCADE
119 CASE    CHANGE  CHAR
120 CHARACTER       CHECK   COLLATE
121 COLUMN  CONDITION       CONSTRAINT
122 CONTINUE        CONVERT         CREATE
123 CROSS   CURRENT_DATE    CURRENT_TIME
124 CURRENT_TIMESTAMP       CURRENT_USER    CURSOR
125 DATABASE        DATABASES       DAY_HOUR
126 DAY_MICROSECOND         DAY_MINUTE      DAY_SECOND
127 DEC     DECIMAL         DECLARE
128 DEFAULT         DELAYED         DELETE
129 DESC    DESCRIBE        DETERMINISTIC
130 DISTINCT        DISTINCTROW     DIV
131 DOUBLE  DROP    DUAL
132 EACH    ELSE    ELSEIF
133 ENCLOSED        ESCAPED         EXISTS
134 EXIT    EXPLAIN         FALSE
135 FETCH   FLOAT   FLOAT4
136 FLOAT8  FOR     FORCE
137 FOREIGN         FROM    FULLTEXT
138 GENERAL         GRANT   GROUP
139 HAVING  HIGH_PRIORITY   HOUR_MICROSECOND
140 HOUR_MINUTE     HOUR_SECOND     IF
141 IGNORE  IGNORE_SERVER_IDS       IN
142 INDEX   INFILE  INNER
143 INOUT   INSENSITIVE     INSERT
144 INT     INT1    INT2
145 INT3    INT4    INT8
146 INTEGER         INTERVAL        INTO
147 IS      ITERATE         JOIN
148 KEY     KEYS    KILL
149 LEADING         LEAVE   LEFT
150 LIKE    LIMIT   LINEAR
151 LINES   LOAD    LOCALTIME
152 LOCALTIMESTAMP  LOCK    LONG
153 LONGBLOB        LONGTEXT        LOOP
154 LOW_PRIORITY    MASTER_HEARTBEAT_PERIOD         MASTER_SSL_VERIFY_SERVER_CERT
155 MATCH   MAXVALUE        MEDIUMBLOB
156 MEDIUMINT       MEDIUMTEXT      MIDDLEINT
157 MINUTE_MICROSECOND      MINUTE_SECOND   MOD
158 MODIFIES        NATURAL         NOT
159 NO_WRITE_TO_BINLOG      NULL    NUMERIC
160 ON      OPTIMIZE        OPTION
161 OPTIONALLY      OR      ORDER
162 OUT     OUTER   OUTFILE
163 PRECISION       PRIMARY         PROCEDURE
164 PURGE   RANGE   READ
165 READS   READ_WRITE      REAL
166 REFERENCES      REGEXP  RELEASE
167 RENAME  REPEAT  REPLACE
168 REQUIRE         RESIGNAL        RESTRICT
169 RETURN  REVOKE  RIGHT
170 RLIKE   SCHEMA  SCHEMAS
171 SECOND_MICROSECOND      SELECT  SENSITIVE
172 SEPARATOR       SET     SHOW
173 SIGNAL  SLOW    SMALLINT
174 SPATIAL         SPECIFIC        SQL
175 SQLEXCEPTION    SQLSTATE        SQLWARNING
176 SQL_BIG_RESULT  SQL_CALC_FOUND_ROWS     SQL_SMALL_RESULT
177 SSL     STARTING        STRAIGHT_JOIN
178 TABLE   TERMINATED      THEN
179 TINYBLOB        TINYINT         TINYTEXT
180 TO      TRAILING        TRIGGER
181 TRUE    UNDO    UNION
182 UNIQUE  UNLOCK  UNSIGNED
183 UPDATE  USAGE   USE
184 USING   UTC_DATE        UTC_TIME
185 UTC_TIMESTAMP   VALUES  VARBINARY
186 VARCHAR         VARCHARACTER    VARYING
187 WHEN    WHERE   WHILE
188 WITH    WRITE   XOR
189 YEAR_MONTH      ZEROFILL         
190
191 The following are new reserved words in MySQL 5.5:
192 GENERAL         IGNORE_SERVER_IDS       MASTER_HEARTBEAT_PERIOD
193 MAXVALUE        RESIGNAL        SIGNAL
194 SLOW             
195
196 MySQL permits some keywords to be used as unquoted identifiers because many people previously used them. Examples are those in the following list:
197
198     *
199
200       ACTION
201     *
202
203       BIT
204     *
205
206       DATE
207     *
208
209       ENUM
210     *
211
212       NO
213     *
214
215       TEXT
216     *
217
218       TIME
219     *
220
221       TIMESTAMP
222