How to comment out in PostgreSQL?

by giovanny.lueilwitz , in category: PHP Databases , a year ago

How to comment out in PostgreSQL?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer


by mac , 9 months ago


To comment out a line of code in PostgreSQL, you can use the -- symbol. Anything after -- on a line will be treated as a comment, and will not be executed by the PostgreSQL server.

For example:

SELECT * FROM users;  -- this is a comment

You can also use /* and */ to comment out multiple lines of code:

This is a multi-line comment
It can span multiple lines

Note that these commenting conventions are specific to PostgreSQL, and may not work in other SQL dialects.