Re: \d with triggers: more than one row returned by a subquery used as an expression

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: \d with triggers: more than one row returned by a subquery used as an expression
Дата
Msg-id 152507.1642456920@sss.pgh.pa.us
обсуждение исходный текст
Ответ на \d with triggers: more than one row returned by a subquery used as an expression  (Justin Pryzby <pryzby@telsasoft.com>)
Ответы Re: \d with triggers: more than one row returned by a subquery used as an expression  (Justin Pryzby <pryzby@telsasoft.com>)
Список pgsql-hackers
Justin Pryzby <pryzby@telsasoft.com> writes:
> On Fri, Dec 17, 2021 at 09:43:56AM -0600, Justin Pryzby wrote:
>> I want to mention that the 2nd problem I mentioned here is still broken.
>> https://www.postgresql.org/message-id/20210717010259.GU20208@telsasoft.com
>> It happens if non-inheritted triggers on child and parent have the same name.

> This is the fix I was proposing
> It depends on pg_partition_ancestors() to return its partitions in order:
> this partition => parent => ... => root.

I don't think that works at all.  I might be willing to accept the
assumption about pg_partition_ancestors()'s behavior, but you're also
making an assumption about how the output of pg_partition_ancestors()
is joined to "pg_trigger AS u", and I really don't think that's safe.

ISTM the real problem is the assumption that only related triggers could
share a tgname, which evidently isn't true.  I think this query needs to
actually match on tgparentid, rather than taking shortcuts.  If we don't
want to use a recursive CTE, maybe we could define it as only looking up
to the immediate parent, rather than necessarily finding the root?

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Add last commit LSN to pg_last_committed_xact()
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Removing more vacuumlazy.c special cases, relfrozenxid optimizations