1--
2-- COMMENTS
3--
4SELECT 'trailing' AS first; -- trailing single line
5  first
6----------
7 trailing
8(1 row)
9
10SELECT /* embedded single line */ 'embedded' AS second;
11  second
12----------
13 embedded
14(1 row)
15
16SELECT /* both embedded and trailing single line */ 'both' AS third; -- trailing single line
17 third
18-------
19 both
20(1 row)
21
22SELECT 'before multi-line' AS fourth;
23      fourth
24-------------------
25 before multi-line
26(1 row)
27
28/* This is an example of SQL which should not execute:
29 * select 'multi-line';
30 */
31SELECT 'after multi-line' AS fifth;
32      fifth
33------------------
34 after multi-line
35(1 row)
36
37--
38-- Nested comments
39--
40/*
41SELECT 'trailing' as x1; -- inside block comment
42*/
43/* This block comment surrounds a query which itself has a block comment...
44SELECT /* embedded single line */ 'embedded' AS x2;
45*/
46SELECT -- continued after the following block comments...
47/* Deeply nested comment.
48   This includes a single apostrophe to make sure we aren't decoding this part as a string.
49SELECT 'deep nest' AS n1;
50/* Second level of nesting...
51SELECT 'deeper nest' as n2;
52/* Third level of nesting...
53SELECT 'deepest nest' as n3;
54*/
55Hoo boy. Still two deep...
56*/
57Now just one deep...
58*/
59'deeply nested example' AS sixth;
60         sixth
61-----------------------
62 deeply nested example
63(1 row)
64
65/* and this is the end of the file */
66