8

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?

Evan Carroll
  • 65,432
  • 50
  • 254
  • 507

1 Answers1

10

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.

Evan Carroll
  • 65,432
  • 50
  • 254
  • 507