Debian Codegraph @

autotests/html/test.sql_postgres.html

raw symbols SCIP
1 <!DOCTYPE html>
2 <html><head>
3 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
4 <title>test.sql_postgres</title>
5 <meta name="generator" content="KF5::SyntaxHighlighting - Definition (SQL (PostgreSQL)) - Theme (Breeze Light)"/>
6 </head><body style="background-color:#ffffff;color:#1f1c1b"><pre>
7 <span style="color:#898887">-- PostgreSQL doesn't use # as comment</span>
8 <span style="font-weight:bold">select</span> jsoncol <span style="color:#ca60ca">#></span> <span style="font-weight:bold">array</span>[<span style="color:#e31616">'p1</span><span style="color:#bf0303">'</span>, <span style="color:#e31616">'p2</span><span style="color:#bf0303">'</span>]
9 <span style="font-weight:bold">from</span> some_table
10 <span style="font-weight:bold">where</span> col<span style="color:#ca60ca">#-</span><span style="color:#e31616">'{1, a}</span><span style="color:#bf0303">'</span> <span style="color:#ca60ca">@</span>? <span style="color:#e31616">'$.b ? (@ > 0)</span><span style="color:#bf0303">'</span>;
11
12 <span style="font-weight:bold">SELECT</span>
13
14 <span style="color:#e31616">'Single quoted string</span><span style="color:#bf0303">'</span> <span style="font-weight:bold">AS</span> test01,
15 <span style="color:#e31616">'Backslashes in single-quoted strings are interpreted literally and get no highlighting: \ </span><span style="color:#bf0303">'</span> <span style="font-weight:bold">AS</span> test02,
16 <span style="color:#e31616">'The single-quote character can be escaped by using two of them: </span><span style="color:#924c9d">''</span><span style="color:#e31616"> This is highlighted.</span><span style="color:#bf0303">'</span> <span style="font-weight:bold">AS</span> test03,
17 <span style="color:#e31616">'Line breaks</span>
18 <span style="color:#e31616">are allowed</span><span style="color:#bf0303">'</span> <span style="font-weight:bold">AS</span> test04,
19
20 <span style="color:#bf0303">E'</span><span style="color:#bf0303">Escape strings are introduced with an uppercase E…</span><span style="color:#bf0303">'</span> <span style="font-weight:bold">AS</span> test11,
21 <span style="color:#bf0303">e'</span><span style="color:#bf0303">or a lowercase e.</span><span style="color:#bf0303">'</span> <span style="font-weight:bold">AS</span> test12,
22 <span style="color:#bf0303">E'</span><span style="color:#bf0303">Line breaks</span>
23 <span style="color:#bf0303">are allowed</span><span style="color:#bf0303">'</span> <span style="font-weight:bold">AS</span> test13,
24 <span style="color:#bf0303">E'</span><span style="color:#bf0303">The single-quote character can be escaped by using two of them: </span><span style="color:#924c9d">''</span><span style="color:#bf0303"> This is highlighted.</span><span style="color:#bf0303">'</span> <span style="font-weight:bold">AS</span> test14,
25 <span style="color:#bf0303">E'</span><span style="color:#bf0303">They can have escapes like </span><span style="color:#924c9d">\t</span><span style="color:#bf0303"> or three-digit octal </span><span style="color:#924c9d">\011</span><span style="color:#bf0303"> or two-digit hexadecimal </span><span style="color:#924c9d">\x09</span><span style="color:#bf0303">.</span><span style="color:#bf0303">'</span> <span style="font-weight:bold">AS</span> test15,
26 <span style="color:#bf0303">E'</span><span style="color:#bf0303">Also the escape character itself and the single-quote can be escaped: </span><span style="color:#924c9d">\\</span><span style="color:#bf0303"> and </span><span style="color:#924c9d">\'</span><span style="color:#bf0303"> are highlighted.</span><span style="color:#bf0303">'</span> <span style="font-weight:bold">AS</span> test16,
27 <span style="color:#bf0303">E'</span><span style="color:#bf0303">Non-defined combinations: Example: </span><span style="color:#924c9d">\y</span><span style="color:#bf0303"> is highlighted because it’s treated as escaped characters and substituted by “y”. Even before a line break</span><span style="color:#924c9d">\</span>
28 <span style="color:#bf0303">this is possible.</span><span style="color:#bf0303">'</span> <span style="font-weight:bold">AS</span> test17,
29 <span style="color:#bf0303">E'</span><span style="color:#bf0303">Higher Unicode code points: Hex: Four-digit </span><span style="color:#924c9d">\u1234</span><span style="color:#bf0303"> and eight-digit </span><span style="color:#924c9d">\U00001234</span><span style="color:#bf0303">'</span> <span style="font-weight:bold">AS</span> test18,
30 <span style="color:#bf0303">E'</span><span style="color:#bf0303">These escapes with “u” and “U” are the only one that are not error tolerant: </span><span style="color:#bf0303;text-decoration:underline">\u</span><span style="color:#bf0303">123 and </span><span style="color:#bf0303;text-decoration:underline">\u</span><span style="color:#bf0303">123 are highlighted as errors.</span><span style="color:#bf0303">'</span> <span style="font-weight:bold">AS</span> test19,
31
32 <span style="color:#bf0303">U&amp;'</span><span style="color:#bf0303">Unicode escape strings are introduced with an uppercase U…</span><span style="color:#bf0303">'</span> <span style="font-weight:bold">AS</span> test21,
33 <span style="color:#bf0303">u&amp;'</span><span style="color:#bf0303">or a lowercase u.</span><span style="color:#bf0303">'</span> <span style="font-weight:bold">AS</span> test22,
34 <span style="color:#bf0303">U&amp;'</span><span style="color:#bf0303">The single-quote character can be escaped by using two of them: </span><span style="color:#924c9d">''</span><span style="color:#bf0303"> This is highlighted.</span><span style="color:#bf0303">'</span> <span style="font-weight:bold">AS</span> test23,
35 <span style="color:#bf0303">U&amp;'</span><span style="color:#bf0303">Types of escape: </span><span style="color:#924c9d">\0061</span><span style="color:#bf0303"> and </span><span style="color:#924c9d">\+000061</span><span style="color:#bf0303"> and </span><span style="color:#924c9d">\\</span><span style="color:#bf0303">'</span> <span style="font-weight:bold">AS</span> test24,
36 <span style="color:#bf0303">U&amp;'</span><span style="color:#bf0303">All other usages of </span><span style="color:#bf0303;text-decoration:underline">\</span><span style="color:#bf0303"> are errors, including </span><span style="color:#bf0303;text-decoration:underline">\</span><span style="color:#bf0303">'</span> test25,
37 <span style="color:#bf0303">U&amp;'</span><span style="color:#bf0303">Line breaks</span>
38 <span style="color:#bf0303">are allowed</span><span style="color:#bf0303">'</span> <span style="font-weight:bold">AS</span> test26,
39
40 <span style="color:#bf0303">U&amp;'</span><span style="color:#bf0303">User-defined escape characters can be used instead of \ by specifying</span><span style="color:#bf0303">'</span> <span style="font-weight:bold">UESCAPE</span> <span style="color:#e31616">'w</span><span style="color:#bf0303">'</span> <span style="font-weight:bold">AS</span> test31,
41 <span style="color:#bf0303">U&amp;'</span><span style="color:#bf0303">Here, \ behaves as normal character. Escape sequences: </span><span style="color:#924c9d">w0061</span><span style="color:#bf0303"> and </span><span style="color:#924c9d">w+000061</span><span style="color:#bf0303"> and </span><span style="color:#924c9d">ww</span><span style="color:#bf0303">'</span> <span style="font-weight:bold">UESCAPE</span> <span style="color:#e31616">'w</span><span style="color:#bf0303">'</span> <span style="font-weight:bold">AS</span> test32,
42 <span style="color:#bf0303">U&amp;'</span><span style="color:#bf0303">Also work correctly for escape characters that have a special meaning in Regular Expressions: </span><span style="color:#924c9d">.0061</span><span style="color:#bf0303"> </span><span style="color:#924c9d">.+000061</span><span style="color:#bf0303"> and </span><span style="color:#924c9d">..</span><span style="color:#bf0303">'</span> <span style="font-weight:bold">UESCAPE</span> <span style="color:#e31616">'.</span><span style="color:#bf0303">'</span> <span style="font-weight:bold">AS</span> test33,
43
44 <span style="color:#b08000">0</span> <span style="font-weight:bold">AS</span> <span style="color:#006e28">U&amp;"Unicode escape identifiers are introduces with an uppercase U…"</span>,
45 <span style="color:#b08000">0</span> <span style="font-weight:bold">AS</span> <span style="color:#006e28">u&amp;"or a lowercase u."</span>,
46 <span style="color:#b08000">0</span> <span style="font-weight:bold">AS</span> <span style="color:#006e28">U&amp;"The double-quote character can be escaped by using two of them: </span><span style="color:#924c9d">""</span><span style="color:#006e28"> This is highlighted."</span>,
47 <span style="color:#b08000">0</span> <span style="font-weight:bold">AS</span> <span style="color:#006e28">U&amp;"Types of escape: </span><span style="color:#924c9d">\0061</span><span style="color:#006e28"> and </span><span style="color:#924c9d">\+000061</span><span style="color:#006e28"> and </span><span style="color:#924c9d">\\</span><span style="color:#006e28">"</span>,
48 <span style="color:#b08000">0</span> <span style="font-weight:bold">AS</span> <span style="color:#006e28">U&amp;"All other usages of </span><span style="color:#bf0303;text-decoration:underline">\</span><span style="color:#006e28"> are errors, including </span><span style="color:#bf0303;text-decoration:underline">\</span><span style="color:#006e28">"</span>,
49 <span style="color:#b08000">0</span> <span style="font-weight:bold">AS</span> <span style="color:#006e28">U&amp;"Line breaks</span>
50 <span style="color:#006e28">are allowed"</span>
51
52 <span style="color:#644a9b">power</span>(<span style="color:#b08000">2</span>, <span style="color:#b08000">3</span>) <span style="font-weight:bold">AS</span> test31, <span style="color:#898887">-- PostgreSQL Build-in functions (like “power”) are highlighted when followed by an opening parenthesis…</span>
53 power <span style="font-weight:bold">AS</span> test32, <span style="color:#b08000">0</span> <span style="font-weight:bold">AS</span> power, <span style="color:#898887">-- …but not highlighted if used as identifier.</span>
54 <span style="color:#0095ff;font-weight:bold">ST_PointOnSurface</span>(way) <span style="font-weight:bold">AS</span> test33, <span style="color:#898887">-- PostGIS functions are highlighted as extensions.</span>
55
56 <span style="color:#898887">-- User-defined functions get no special highlighting:</span>
57 testpower(<span style="color:#b08000">2</span>, <span style="color:#b08000">3</span>) <span style="font-weight:bold">AS</span> test34,
58
59 foo <span style="font-weight:bold">AS</span> bar
60
61 <span style="font-weight:bold">FROM</span> mytable;
62 </pre></body></html>