Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.
Дата
Msg-id CA+TgmoZK1jk1VfTHehWJAv2OuM7edmJUDwL0f_sMJaGBY9ihmA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Список pgsql-hackers
On Wed, Dec 21, 2016 at 8:00 PM, Amit Langote
<Langote_Amit_f8@lab.ntt.co.jp> wrote:
> On 2016/12/22 0:31, Robert Haas wrote:
>> On Tue, Dec 20, 2016 at 12:22 PM, Alvaro Herrera
>> <alvherre@2ndquadrant.com> wrote:
>>> Robert Haas wrote:
>>>> Implement table partitioning.
>>>
>>> I thought it was odd to use rd_rel->reloftype as a boolean in
>>> ATExecAttachPartition, but apparently we do it elsewhere too, so let's
>>> leave that complaint for another day.
>>
>> Ugh.  I agree - that's bad style.
>
> Agreed, fixed in the attached patch.
>
>>> What I also found off in the same function is that we use
>>> SearchSysCacheCopyAttName() on each attribute and then don't free the
>>> result, and don't ever use the returned tuple either.  A simple fix, I
>>> thought, just remove the "Copy" and add a ReleaseSysCache().
>>
>> Or use SearchSysCachExists.
>
> Done, too.
>
>>> But then I
>>> noticed this whole thing is rather strange -- why not pass a boolean
>>> flag down to CreateInheritance() and from there to
>>> MergeAttributesIntoExisting() to implement the check?  That seems less
>>> duplicative.
>>
>> Hmm, that would be another way to do it.
>
> MergeAttributesIntoExisting() is called by ATExecAddInherit() as well,
> where we don't want to check that.  Sure, we can only check if
> child_is_partition, but I thought it'd be better to keep the shared code
> (between regular inheritance and partitioning) as close to the old close
> as possible.
>
> Attached patch also fixes a couple of other minor issues.

Committed.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] Potential data loss of 2PC files
Следующее
От: Joe Conway
Дата:
Сообщение: Re: [HACKERS] Getting rid of "unknown error" in dblink andpostgres_fdw