=?utf-8?B?0JTQvNC40YLRgNC40Lkg0JLQvtGA0L7QvdC40L0=?= <carriingfat...@yandex.ru> writes: > When we create/alter object we already add dependency row to pg_depend > (or, pg_shdepend) table for object that is depends (e.g. trigger depends > on table which it created). But when I add comment on table, no one > dependency row is added. Why?
Comments aren't interesting for dependency purposes: nothing can depend on a comment, nor does a comment depend on anything but its one owning object, they aren't relevant for CASCADE/RESTRICT rules, etc. So tracking them in pg_depend would just bloat pg_depend for little gain. It's simpler to have hard-wired logic to look for a comment and delete it when any object is deleted. regards, tom lane