Re: Dependences records and comments

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Дмитрий Воронин <carriingfate92(at)yandex(dot)ru>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Dependences records and comments
Date: 2019-04-10 04:57:24
Message-ID: 3959.1554872244@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

=?utf-8?B?0JTQvNC40YLRgNC40Lkg0JLQvtGA0L7QvdC40L0=?= <carriingfate92(at)yandex(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2019-04-10 05:19:59 Re: [HACKERS] Block level parallel vacuum
Previous Message David Rowley 2019-04-10 04:34:35 Re: pg_dump is broken for partition tablespaces