How to write Multi-line comments in Postgres SQL?

In PostgreSQL, you can write multi-line comments using the /* ... */ syntax, similar to many programming languages.

Example 1:

/*
This is a multi-line comment.
You can write as much as you want here.
Useful for documenting SQL scripts.
*/

SELECT * FROM employees;

Example 2:

/*
alter table socialintel 
ADD COLUMN posturl varchar(200);

*/

Key points:
Everything between /* and */ is treated as a comment.

Multiline comment Support - Multi-line comments can be nested only in PostgreSQL 16 and later. For earlier versions, nesting multi-line comments is not supported.