PostgreSQL has a special piece of a functionality called COMMENT which attaches metadata to an identifier or any type (schema, table, column, function, type, domain, etc). It looks like this,

COMMENT ON TABLE mytable IS 'This is my table.';

Is there a maximum size for the comment?

1 Answer 1


COMMENT has no impositions other than it fit into a TEXT field (verified in IRC with RhodiumToad),

From the docs,

Very long values are also stored in background tables so that they do not interfere with rapid access to shorter column values. In any case, the longest possible character string that can be stored is about 1 GB.

So if you're under a GB or thereabout, you're probably fine.

  • 2
    The real question is: "Will that be enough?" ;-)
    – Vérace
    Feb 26, 2019 at 7:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.