Single-Line Comment
By default, the content following "--" is regarded as a single-line comment in a database and syntax parsing is not performed. If the m_format_behavior_compat_options parameter contains the forbid_none_space_comment option, a space must be added after "--", and only the content after the space is considered as a single-line comment.
Example
-- Basic scenario of a single-line comment m_db=# SET m_format_behavior_compat_options='forbid_none_space_comment'; SET m_db=# SELECT 'abc' -- 1; m_db-# ; ?column? ---------- abc (1 row) -- Special scenario of a single-line comment m_db=# select 'a'--; ?column? ---------- a (1 row) -- The priority of comments is lower than that of quotation marks. m_db=# select '-- abc'; ?column? ---------- -- abc (1 row)
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot