PostgreSQL lets you set a column description directly with COMMENT ON COLUMN. MySQL 8.4 stores a column comment as part of the column definition, so changing one on an existing table uses ALTER TABLE. In either database, “without a migration” means the SQL does not itself require a migration file; your team may still require all schema metadata changes to go through its deployment process.
Set a column comment in PostgreSQL
Use COMMENT ON COLUMN to add or replace a column description. For example:
As an Amazon Associate I earn from qualifying purchases.
COMMENT ON COLUMN public.customer.email IS 'Primary contact email supplied by the customer';
The command targets a column belonging to a table, view, composite type, or foreign table. Qualify the object with its schema when needed to identify it unambiguously. A new comment replaces the existing comment; use NULL or an empty string to remove it. The comment is dropped if the database object is dropped. The PostgreSQL 17 reference says this command acquires a SHARE UPDATE EXCLUSIVE lock on the object. PostgreSQL 17 COMMENT reference.
This is a metadata statement, not a replacement column definition. Whether you run it directly or include it in a migration is a deployment-policy decision.
#1 Best Overall
View PostgreSQL column comments
In psql, use the d family of commands to inspect database objects and their descriptions. For a queryable catalog view, PostgreSQL stores optional object descriptions in pg_description; for a column comment, the column number is recorded in objsubid. PostgreSQL also provides col_description for retrieving a column description. See the pg_description catalog reference and the COMMENT reference.
Set or change a column comment in MySQL 8.4
MySQL 8.4 specifies a column comment with the column definition’s COMMENT attribute. For a new table, for example:
Rank #2
CREATE TABLE customer (
email VARCHAR(320) COMMENT 'Primary contact email supplied by the customer'
);
The MySQL 8.4 manual documents a maximum column-comment length of 1024 characters. See the MySQL 8.4 CREATE TABLE reference.
Change the comment on an existing column
To change a comment on an existing table, use ALTER TABLE with a column-definition operation such as MODIFY COLUMN or, where appropriate, CHANGE COLUMN. The example below assumes the existing column is exactly VARCHAR(320) with no other attributes:
Rank #3
ALTER TABLE customer
MODIFY COLUMN email VARCHAR(320)
COMMENT 'Primary contact email supplied by the customer';
Do not copy that simplified definition blindly. Before applying it, check the real column definition and preserve its type, nullability, default, generated expression, visibility, and any other relevant attributes. A comment-only intent does not guarantee that every MySQL server, storage engine, or table configuration will perform the alteration instantly or without rebuilding the table; the documented operation is a column change, and its operational impact can vary. Consult the MySQL 8.4 ALTER TABLE reference and assess the change for your environment.
Inspect column comments in MySQL
MySQL 8.4 exposes column comments through SHOW FULL COLUMNS, SHOW CREATE TABLE, and INFORMATION_SCHEMA.COLUMNS.COLUMN_COMMENT. To query comments for a specific table:
SELECT COLUMN_NAME, COLUMN_COMMENT
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = 'app'
AND TABLE_NAME = 'customer';
Filtering on both schema and table avoids mixing results for tables with the same name in different databases. The COLUMNS table also reports details such as data type, nullability, and default. See the MySQL 8.4 INFORMATION_SCHEMA COLUMNS reference.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →What differs between PostgreSQL and MySQL?
| Task | PostgreSQL 17 | MySQL 8.4 |
|---|---|---|
| Set or update | COMMENT ON COLUMN schema.table.column IS 'Description'; |
Set COMMENT 'Description' in the column definition; for an existing column, use an ALTER TABLE column change. |
| Remove | Use NULL or ''. |
The reviewed MySQL 8.4 reference material does not establish a specific removal instruction here; check the exact version’s syntax before clearing a comment. |
| Inspect | psql d commands, col_description, or pg_description. |
SHOW FULL COLUMNS, SHOW CREATE TABLE, or INFORMATION_SCHEMA.COLUMNS.COLUMN_COMMENT. |
| Documented comment length | Not stated in the cited PostgreSQL 17 references. | Up to 1024 characters in the MySQL 8.4 CREATE TABLE reference. |
| How the SQL represents it | A dedicated comment command. | A column-definition attribute. |
These details are version-specific to PostgreSQL 17 and MySQL 8.4. Check the manual for your deployed version before applying syntax or making operational assumptions.
Keep comments suitable for their visibility
Do not use column comments as a private annotation store. PostgreSQL’s documentation explicitly says that any user connected to a database can see comments for objects in that database and warns against putting security-critical information in them. PostgreSQL 17 COMMENT reference.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




