KXStudio Website https://kx.studio/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

288 lines
13KB

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