ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
postgresql.php
Go to the documentation of this file.
1 <?php
2 /*************************************************************************************
3  * postgresql.php
4  * -----------
5  * Author: Christophe Chauvet (christophe_at_kryskool_dot_org)
6  * Contributors: Leif Biberg Kristensen <leif_at_solumslekt_dot_org> 2010-05-03
7  * Copyright: (c) 2007 Christophe Chauvet (http://kryskool.org/), Nigel McNie (http://qbnz.com/highlighter)
8  * Release Version: 1.0.9.0
9  * Date Started: 2007/07/20
10  *
11  * PostgreSQL language file for GeSHi.
12  *
13  * CHANGES
14  * -------
15  * 2007/07/20 (1.0.0)
16  * - First Release
17  *
18  * TODO (updated 2007/07/20)
19  * -------------------------
20  *
21  *************************************************************************************
22  *
23  * This file is part of GeSHi.
24  *
25  * GeSHi is free software; you can redistribute it and/or modify
26  * it under the terms of the GNU General Public License as published by
27  * the Free Software Foundation; either version 2 of the License, or
28  * (at your option) any later version.
29  *
30  * GeSHi is distributed in the hope that it will be useful,
31  * but WITHOUT ANY WARRANTY; without even the implied warranty of
32  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33  * GNU General Public License for more details.
34  *
35  * You should have received a copy of the GNU General Public License
36  * along with GeSHi; if not, write to the Free Software
37  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
38  *
39  ************************************************************************************/
40 
41 $language_data = array (
42  'LANG_NAME' => 'PostgreSQL',
43  'COMMENT_SINGLE' => array(1 => '--'),
44  'COMMENT_MULTI' => array('/*' => '*/'),
45  'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
46  'QUOTEMARKS' => array("'", '"', '`'),
47  'ESCAPE_CHAR' => '\\',
48  'KEYWORDS' => array(
49  //Put PostgreSQL reserved keywords here. I like mine uppercase.
50  1 => array(
51  'ABORT','ABSOLUTE','ACCESS','ACTION','ADD','ADMIN','AFTER',
52  'AGGREGATE','ALL','ALSO','ALTER','ALWAYS','ANALYSE','ANALYZE','AND',
53  'ANY','AS','ASC,','ASSERTION','ASSIGNMENT','ASYMMETRIC','AT',
54  'AUTHORIZATION','BACKWARD','BEFORE','BEGIN','BETWEEN','BOTH','BY',
55  'CACHE','CALLED','CASCADE','CASCADED','CASE','CAST','CATALOG',
56  'CHAIN','CHARACTERISTICS','CHECK','CHECKPOINT','CLASS','CLOSE',
57  'CLUSTER','COALESCE','COLLATE','COLUMN','COMMENT','COMMIT',
58  'COMMITTED','CONCURRENTLY','CONFIGURATION','CONNECTION',
59  'CONSTRAINT','CONSTRAINTS','CONTENT','CONTINUE','CONVERSION','COPY',
60  'COST','CREATE','CREATEDB','CREATEROLE','CREATEUSER','CROSS','CSV',
61  'CURRENT','CURRENT_CATALOG','CURRENT_DATE','CURRENT_ROLE',
62  'CURRENT_SCHEMA','CURRENT_TIME','CURRENT_TIMESTAMP','CURRENT_USER',
63  'CURSOR','CYCLE','DATA','DATABASE','DAY','DEALLOCATE','DEC',
64  'DECLARE','DEFAULT','DEFAULTS','DEFERRABLE','DEFERRED','DEFINER',
65  'DELETE','DELIMITER','DELIMITERS','DESC','DICTIONARY','DISABLE',
66  'DISCARD','DISTINCT','DO','DOCUMENT','DOMAIN','DOUBLE','DROP',
67  'EACH','ELSE','ENABLE','ENCODING','ENCRYPTED','END','ESCAPE',
68  'EXCEPT','EXCLUDING','EXCLUSIVE','EXECUTE','EXISTS','EXPLAIN',
69  'EXTERNAL','EXTRACT','FALSE','FAMILY','FETCH','FIRST','FOLLOWING',
70  'FOR','FORCE','FOREIGN','FORWARD','FREEZE','FROM','FULL','FUNCTION',
71  'GLOBAL','GRANT','GRANTED','GREATEST','GROUP','HANDLER','HAVING',
72  'HEADER','HOLD','HOUR','IDENTITY','IF','ILIKE','IMMEDIATE',
73  'IMMUTABLE','IMPLICIT','IN','INCLUDING','INCREMENT','INDEX',
74  'INDEXES','INHERIT','INHERITS','INITIALLY','INNER','INOUT','INPUT',
75  'INSENSITIVE','INSERT','INSTEAD','INTERSECT','INTO','INVOKER','IS',
76  'ISNULL','ISOLATION','JOIN','KEY','LANCOMPILER','LANGUAGE','LARGE',
77  'LAST','LC_COLLATE','LC_CTYPE','LEADING','LEAST','LEFT','LEVEL',
78  'LIKE','LIMIT','LISTEN','LOAD','LOCAL','LOCALTIME','LOCALTIMESTAMP',
79  'LOCATION','LOCK','LOGIN','LOOP','MAPPING','MATCH','MAXVALUE',
80  'MINUTE','MINVALUE','MODE','MONTH','MOVE','NAME','NAMES','NATIONAL',
81  'NATURAL','NEW','NEXT','NO','NOCREATEDB','NOCREATEROLE',
82  'NOCREATEUSER','NOINHERIT','NOLOGIN','NONE','NOSUPERUSER','NOT',
83  'NOTHING','NOTIFY','NOTNULL','NOWAIT','NULL','NULLIF','NULLS',
84  'NUMERIC','OBJECT','OF','OFF','OFFSET','OIDS','OLD','ON','ONLY',
85  'OPERATOR','OPTION','OPTIONS','OR','ORDER','OUT','OUTER','OVER',
86  'OVERLAPS','OVERLAY','OWNED','OWNER','PARSER','PARTIAL','PARTITION',
87  'PASSWORD','PLACING','PLANS','POSITION','PRECEDING','PRECISION',
88  'PREPARE','PREPARED','PRESERVE','PRIMARY','PRIOR','PRIVILEGES',
89  'PROCEDURAL','PROCEDURE','QUOTE','RANGE','READ','REASSIGN',
90  'RECHECK','RECURSIVE','REFERENCES','REINDEX','RELATIVE','RELEASE',
91  'RENAME','REPEATABLE','REPLACE','REPLICA','RESET','RESTART',
92  'RESTRICT','RETURN','RETURNING','RETURNS','REVOKE','RIGHT','ROLE',
93  'ROLLBACK','ROW','ROWS','RULE','SAVEPOINT','SCHEMA','SCROLL',
94  'SEARCH','SECOND',
95  'SECURITY','SELECT','SEQUENCE','SERIALIZABLE','SERVER','SESSION',
96  'SESSION_USER','SET','SETOF','SHARE','SHOW','SIMILAR','SIMPLE',
97  'SOME','STABLE','STANDALONE','START','STATEMENT','STATISTICS',
98  'STDIN','STDOUT','STORAGE','STRICT','STRIP','SUPERUSER',
99  'SYMMETRIC','SYSID','SYSTEM','TABLE','TABLESPACE','TEMP','TEMPLATE',
100  'TEMPORARY','THEN','TO','TRAILING','TRANSACTION','TREAT','TRIGGER',
101  'TRUE','TRUNCATE','TRUSTED','TYPE','UNBOUNDED','UNCOMMITTED',
102  'UNENCRYPTED','UNION','UNIQUE','UNKNOWN','UNLISTEN','UNTIL',
103  'UPDATE','USER','USING','VACUUM','VALID','VALIDATOR','VALUE',
104  'VALUES','VARIADIC','VERBOSE','VERSION','VIEW','VOLATILE','WHEN',
105  'WHERE','WHILE','WHITESPACE','WINDOW','WITH','WITHOUT','WORK','WRAPPER',
106  'WRITE','XMLATTRIBUTES','XMLCONCAT','XMLELEMENT','XMLFOREST',
107  'XMLPARSE','XMLPI','XMLROOT','XMLSERIALIZE','YEAR','YES','ZONE'
108  ),
109 
110  //Put functions here
111  3 => array(
112  // mathematical functions
113  'ABS','CBRT','CEIL','CEILING','DEGREES','DIV','EXP','FLOOR','LN',
114  'LOG','MOD','PI','POWER','RADIANS','RANDOM','ROUND','SETSEED',
115  'SIGN','SQRT','TRUNC','WIDTH_BUCKET',
116  // trigonometric functions
117  'ACOS','ASIN','ATAN','ATAN2','COS','COT','SIN','TAN',
118  // string functions
119  'BIT_LENGTH','CHAR_LENGTH','CHARACTER_LENGTH','LOWER',
120  'OCTET_LENGTH','POSITION','SUBSTRING','TRIM','UPPER',
121  // other string functions
122  'ASCII','BTRIM','CHR','CONVERT','CONVERT_FROM','CONVERT_TO',
123  'DECODE','ENCODE','INITCAP','LENGTH','LPAD','LTRIM','MD5',
124  'PG_CLIENT_ENCODING','QUOTE_IDENT','QUOTE_LITERAL','QUOTE_NULLABLE',
125  'REGEXP_MATCHES','REGEXP_REPLACE','REGEXP_SPLIT_TO_ARRAY',
126  'REGEXP_SPLIT_TO_TABLE','REPEAT','RPAD','RTRIM','SPLIT_PART',
127  'STRPOS','SUBSTR','TO_ASCII','TO_HEX','TRANSLATE',
128  // binary string functions
129  'GET_BIT','GET_BYTE','SET_BIT','SET_BYTE',
130  // data type formatting functions
131  'TO_CHAR','TO_DATE','TO_NUMBER','TO_TIMESTAMP',
132  // date/time functions
133  'AGE','CLOCK_TIMESTAMP','DATE_PART','DATE_TRUNC','EXTRACT',
134  'ISFINITE','JUSTIFY_DAYS','JUSTIFY_HOURS','JUSTIFY_INTERVAL','NOW',
135  'STATEMENT_TIMESTAMP','TIMEOFDAY','TRANSACTION_TIMESTAMP',
136  // enum support functions
137  'ENUM_FIRST','ENUM_LAST','ENUM_RANGE',
138  // geometric functions
139  'AREA','CENTER','DIAMETER','HEIGHT','ISCLOSED','ISOPEN','NPOINTS',
140  'PCLOSE','POPEN','RADIUS','WIDTH',
141  'BOX','CIRCLE','LSEG','PATH','POINT','POLYGON',
142  // cidr and inet functions
143  'ABBREV','BROADCAST','FAMILY','HOST','HOSTMASK','MASKLEN','NETMASK',
144  'NETWORK','SET_MASKLEN',
145  // text search functions
146  'TO_TSVECTOR','SETWEIGHT','STRIP','TO_TSQUERY','PLAINTO_TSQUERY',
147  'NUMNODE','QUERYTREE','TS_RANK','TS_RANK_CD','TS_HEADLINE',
148  'TS_REWRITE','GET_CURRENT_TS_CONFIG','TSVECTOR_UPDATE_TRIGGER',
149  'TSVECTOR_UPDATE_TRIGGER_COLUMN',
150  'TS_DEBUG','TS_LEXISE','TS_PARSE','TS_TOKEN_TYPE','TS_STAT',
151  // XML functions
152  'XMLCOMMENT','XMLCONCAT','XMLELEMENT','XMLFOREST','XMLPI','XMLROOT',
153  'XMLAGG','XPATH','TABLE_TO_XMLSCHEMA','QUERY_TO_XMLSCHEMA',
154  'CURSOR_TO_XMLSCHEMA','TABLE_TO_XML_AND_XMLSCHEMA',
155  'QUERY_TO_XML_AND_XMLSCHEMA','SCHEMA_TO_XML','SCHEMA_TO_XMLSCHEMA',
156  'SCHEMA_TO_XML_AND_XMLSCHEMA','DATABASE_TO_XML',
157  'DATABASE_TO_XMLSCHEMA','DATABASE_TO_XML_AND_XMLSCHEMA',
158  // sequence manipulating functions
159  'CURRVAL','LASTVAL','NEXTVAL','SETVAL',
160  // conditional expressions
161  'COALESCE','NULLIF','GREATEST','LEAST',
162  // array functions
163  'ARRAY_APPEND','ARRAY_CAT','ARRAY_NDIMS','ARRAY_DIMS','ARRAY_FILL',
164  'ARRAY_LENGTH','ARRAY_LOWER','ARRAY_PREPEND','ARRAY_TO_STRING',
165  'ARRAY_UPPER','STRING_TO_ARRAY','UNNEST',
166  // aggregate functions
167  'ARRAY_AGG','AVG','BIT_AND','BIT_OR','BOOL_AND','BOOL_OR','COUNT',
168  'EVERY','MAX','MIN','STRING_AGG','SUM',
169  // statistic aggregate functions
170  'CORR','COVAR_POP','COVAR_SAMP','REGR_AVGX','REGR_AVGY',
171  'REGR_COUNT','REGR_INTERCEPT','REGR_R2','REGR_SLOPE','REGR_SXX',
172  'REGR_SXY','REGR_SYY','STDDEV','STDDEV_POP','STDDEV_SAMP',
173  'VARIANCE','VAR_POP','VAR_SAMP',
174  // window functions
175  'ROW_NUMBER','RANK','DENSE_RANK','PERCENT_RANK','CUME_DIST','NTILE',
176  'LAG','LEAD','FIRST_VALUE','LAST_VALUE','NTH_VALUE',
177  // set returning functions
178  'GENERATE_SERIES','GENERATE_SUBSCRIPTS'
179  // system information functions not currently included
180  ),
181 
182  //Put your postgresql var
183  4 => array(
184  'client_encoding',
185  'standard_conforming_strings'
186  ),
187 
188  //Put your data types here
189  5 => array(
190  'ARRAY','ABSTIME','BIGINT','BIGSERIAL','BINARY','BIT','BIT VARYING',
191  'BOOLEAN','BOX','BYTEA','CHAR','CHARACTER','CHARACTER VARYING',
192  'CIDR','CIRCLE','DATE','DECIMAL','DOUBLE PRECISION','ENUM','FLOAT',
193  'INET','INT','INTEGER','INTERVAL','NCHAR','REAL','SMALLINT','TEXT',
194  'TIME','TIMESTAMP','VARCHAR','XML',
195  ),
196 
197  // //Put your package names here
198  // 6 => array(
199  // ),
200 
201  ),
202  'SYMBOLS' => array(
203  '(', ')', '=', '<', '>', '|'
204  ),
205  'CASE_SENSITIVE' => array(
206  GESHI_COMMENTS => false,
207  1 => false,
208  3 => false,
209  4 => false,
210  5 => false
211  ),
212  'STYLES' => array(
213  'KEYWORDS' => array(
214  // regular keywords
215  1 => 'color: #000000; font-weight: bold; text-transform: uppercase;',
216  // inbuilt functions
217  3 => 'color: #333399; font-weight: bold; text-transform: uppercase;',
218  // postgresql var(?)
219  4 => 'color: #993333; font-weight: bold; text-transform: uppercase;',
220  // data types
221  5 => 'color: #993333; font-weight: bold; text-transform: uppercase;',
222  ),
223  'COMMENTS' => array(
224  1 => 'color: #808080; font-style: italic;',
225  ),
226  'ESCAPE_CHAR' => array(
227  0 => 'color: #000099; font-weight: bold;'
228  ),
229  'BRACKETS' => array(
230  0 => 'color: #66cc66;'
231  ),
232  'STRINGS' => array(
233  0 => 'color: #ff0000;'
234  ),
235  'NUMBERS' => array(
236  0 => 'color: #cc66cc;'
237  ),
238  'METHODS' => array(
239  1 => 'color: #ff0000;'
240  ),
241  'SYMBOLS' => array(
242  0 => 'color: #66cc66;'
243  ),
244  'SCRIPT' => array(
245  ),
246  'REGEXPS' => array(
247  )
248  ),
249  'URLS' => array(
250  1 => '',
251  3 => '',
252  4 => 'http://paste.postgresql.fr/wiki/desc.php?def={FNAME}',
253  5 => '',
254  ),
255 
256  'OOLANG' => false,
257  'OBJECT_SPLITTERS' => array(
258  ),
259  'REGEXPS' => array(
260  ),
261  'STRICT_MODE_APPLIES' => GESHI_NEVER,
262  'SCRIPT_DELIMITERS' => array(
263  ),
264  'HIGHLIGHT_STRICT_BLOCK' => array(
265  ),
266  'PARSER_CONTROL' => array(
267  'KEYWORDS' => array(
268  1 => array(
269  'DISALLOWED_AFTER' => '(?![\(\w])'
270  ),
271 
272  3 => array(
273  'DISALLOWED_AFTER' => '(?=\()'
274  ),
275 
276  4 => array(
277  'DISALLOWED_AFTER' => '(?![\(\w])'
278  ),
279 
280  5 => array(
281  'DISALLOWED_AFTER' => '(?![\(\w])'
282  ),
283  )
284  )
285 );
const GESHI_COMMENTS
Used in language files to mark comments.
Definition: geshi.php:149
$language_data
Definition: postgresql.php:41
const GESHI_NEVER
#+ private
Definition: geshi.php:123
const GESHI_CAPS_NO_CHANGE
Lowercase keywords found.
Definition: geshi.php:94