Re: Missing dependency tracking for TableFunc nodes

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Missing dependency tracking for TableFunc nodes
Дата
Msg-id 20191114222729.GA23410@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: Missing dependency tracking for TableFunc nodes  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Ответы Re: Missing dependency tracking for TableFunc nodes  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Список pgsql-hackers
On 2019-Nov-14, Tomas Vondra wrote:

> Isn't that solved by RemoveObjects() doing this?
> 
>    /* Get an ObjectAddress for the object. */
>    address = get_object_address(stmt->removeType,
>                                 object,
>                                 &relation,
>                                 AccessExclusiveLock,
>                                 stmt->missing_ok);
> 
> I've actually done some debugging before sending the patch, and I think
> this prevent the issue you describe.

Hmm .. shouldn't get_statistics_object_oid get a lock on the table that
owns the stats object too?  I think it should be setting *relp to it.
That way, the lock you're proposing to add would be obtained there.
That means it'd be similar to what we do for OBJECT_TRIGGER etc,
get_object_address_relobject().

I admit this'd crash and burn if we had stats on multiple relations,
because there'd be no way to return the multiple relations that would
end up locked.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



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

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: Missing dependency tracking for TableFunc nodes
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Missing dependency tracking for TableFunc nodes