comments.out 1.3 KB

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