How Do I Write a Comment in Postgresql

How Do I Write a Comment in Postgresql

In PostgreSQL, a comment started with — symbol is similar to a comment starting with # symbol. When using the — symbol, the comment must be at the end of a line in your SQL statement with a line break after it. This method of commenting can only span a single line within your SQL and must be at the end of the line.

How do you comment on Pgadmin?

Ctrl k will comment out a block of code, while Ctrl-Shift k will uncomment out the block.

How do you comment a table in SQL?

Use the COMMENT statement to add a comment about a table, view, materialized view, or column into the data dictionary. To drop a comment from the database, set it to the empty string ‘ ‘. See Also: “Comments” for more information on associating comments with SQL statements and schema objects.

David Miller
Author

David Miller

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.