Warning, /frameworks/syntax-highlighting/autotests/input/test.sql_postgres is written in an unsupported language. File is not indexed.
0001 -- PostgreSQL doesn't use # as comment 0002 select jsoncol #> array['p1', 'p2'] 0003 from some_table 0004 where col#-'{1, a}' @? '$.b ? (@ > 0)'; 0005 0006 SELECT 0007 0008 'Single quoted string' AS test01, 0009 'Backslashes in single-quoted strings are interpreted literally and get no highlighting: \ ' AS test02, 0010 'The single-quote character can be escaped by using two of them: '' This is highlighted.' AS test03, 0011 'Line breaks 0012 are allowed' AS test04, 0013 0014 E'Escape strings are introduced with an uppercase E…' AS test11, 0015 e'or a lowercase e.' AS test12, 0016 E'Line breaks 0017 are allowed' AS test13, 0018 E'The single-quote character can be escaped by using two of them: '' This is highlighted.' AS test14, 0019 E'They can have escapes like \t or three-digit octal \011 or two-digit hexadecimal \x09.' AS test15, 0020 E'Also the escape character itself and the single-quote can be escaped: \\ and \' are highlighted.' AS test16, 0021 E'Non-defined combinations: Example: \y is highlighted because it’s treated as escaped characters and substituted by “y”. Even before a line break\ 0022 this is possible.' AS test17, 0023 E'Higher Unicode code points: Hex: Four-digit \u1234 and eight-digit \U00001234' AS test18, 0024 E'These escapes with “u” and “U” are the only one that are not error tolerant: \u123 and \u123 are highlighted as errors.' AS test19, 0025 0026 U&'Unicode escape strings are introduced with an uppercase U…' AS test21, 0027 u&'or a lowercase u.' AS test22, 0028 U&'The single-quote character can be escaped by using two of them: '' This is highlighted.' AS test23, 0029 U&'Types of escape: \0061 and \+000061 and \\' AS test24, 0030 U&'All other usages of \ are errors, including \' test25, 0031 U&'Line breaks 0032 are allowed' AS test26, 0033 0034 U&'User-defined escape characters can be used instead of \ by specifying' UESCAPE 'w' AS test31, 0035 U&'Here, \ behaves as normal character. Escape sequences: w0061 and w+000061 and ww' UESCAPE 'w' AS test32, 0036 U&'Also work correctly for escape characters that have a special meaning in Regular Expressions: .0061 .+000061 and ..' UESCAPE '.' AS test33, 0037 0038 0 AS U&"Unicode escape identifiers are introduces with an uppercase U…", 0039 0 AS u&"or a lowercase u.", 0040 0 AS U&"The double-quote character can be escaped by using two of them: "" This is highlighted.", 0041 0 AS U&"Types of escape: \0061 and \+000061 and \\", 0042 0 AS U&"All other usages of \ are errors, including \", 0043 0 AS U&"Line breaks 0044 are allowed" 0045 0046 power(2, 3) AS test31, -- PostgreSQL Build-in functions (like “power”) are highlighted when followed by an opening parenthesis… 0047 power AS test32, 0 AS power, -- …but not highlighted if used as identifier. 0048 ST_PointOnSurface(way) AS test33, -- PostGIS functions are highlighted as extensions. 0049 0050 -- User-defined functions get no special highlighting: 0051 testpower(2, 3) AS test34, 0052 0053 foo AS bar 0054 0055 FROM mytable;