Re: ALTER TABLE on system catalogs

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: ALTER TABLE on system catalogs
Дата
Msg-id 61666008-d1cd-7a66-33c8-215449f5d1b0@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: ALTER TABLE on system catalogs  (Andres Freund <andres@anarazel.de>)
Ответы Re: ALTER TABLE on system catalogs  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
Список pgsql-hackers
On 21/08/2018 17:24, Andres Freund wrote:
>> Attached is a patch that instead moves those special cases into
>> needs_toast_table(), which was one of the options suggested by Andres.
>> There were already similar checks there, so I guess this makes a bit of
>> sense.
> The big difference is that that then only takes effect when called with
> check=true. The callers without it, importantly NewHeapCreateToastTable
> & NewRelationCreateToastTable, then won't run into this check. But still
> into the error (see below).

I don't follow.  The call to needs_toast_table() is not conditional on
the check argument.  The check argument only checks that the correct
lock level is passed in.

>> @@ -145,21 +146,6 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
>>      ObjectAddress baseobject,
>>                  toastobject;
>>  
>> -    /*
>> -     * Toast table is shared if and only if its parent is.
>> -     *
>> -     * We cannot allow toasting a shared relation after initdb (because
>> -     * there's no way to mark it toasted in other databases' pg_class).
>> -     */
>> -    shared_relation = rel->rd_rel->relisshared;
>> -    if (shared_relation && !IsBootstrapProcessingMode())
>> -        ereport(ERROR,
>> -                (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
>> -                 errmsg("shared tables cannot be toasted after initdb")));
> This error check imo shouldn't be removed, but moved down.

We could keep it, but it would probably be dead code since
needs_toast_table() would return false for all shared tables anyway.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Continue work on changes to recovery.conf API
Следующее
От: Mark Wong
Дата:
Сообщение: Re: Odd 9.4, 9.3 buildfarm failure on s390x