Postgresql – Is the “comments” field in pgAdmin 4 a pgAdmin thing, or is it a PostgreSQL feature

commentspgadmin-4postgresql

If I right-click a table (or any object) in pgAdmin 4 and select "Properties", it brings up a GUI window which allows me to change the name of the table and many other things.

One of the fields is called "Comment". The manual for pgAdmin 4 just states this useless description:

Store notes about the table in the Comment field.

Where exactly is this stored? In the actual PostgreSQL database? Or some separate, special pgAdmin storage?

It seems to have nothing to do with the SQL comments such as:

-- This is an SQL comment.

Also, if I add such SQL comments inside my query, are they discarded by both PostgreSQL and pgAdmin, or added somewhere? For example, this query:

CREATE TABLE blablabla ...; -- This table is so cool, dude.

Would "This table is so cool, dude." just be stripped away by both pgAdmin and PG?

I looked in the PG manual but found no special "COMMENTS" feature, where the comment is actually stored in PG. For example, something like this:

CREATE TABLE blablabla ... WITH COMMENT 'This table is so cool, dude.';

Please clarify.

Best Answer

It's a Postgres thing

create table blabla (...);
comment on table blabla is 'This tables stores important information';