Re: using expression syntax for partition bounds

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: peter(dot)eisentraut(at)2ndquadrant(dot)com, pgsql-hackers(at)postgresql(dot)org, tgl(at)sss(dot)pgh(dot)pa(dot)us
Subject: Re: using expression syntax for partition bounds
Date: 2019-01-24 10:29:29
Message-ID: cf023fdf-0f98-3aca-7354-389ab2f4c8fc@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Horiguchi-san,

Thanks for checking.

On 2019/01/24 19:03, Kyotaro HORIGUCHI wrote:
> At Fri, 18 Jan 2019 17:50:56 +0900, Amit Langote wrote:
>> On 2019/01/18 16:48, Peter Eisentraut wrote:
>>>> How about the following note in the documentation:
>>>>
>>>> + Although volatile expressions such as
>>>> + <literal><function>CURRENT_TIMESTAMP</function></literal> can be used
>>>> + for this, be careful when using them, because
>>>> + <productname>PostgreSQL</productname> will evaluate them only once
>>>> + when adding the partition.
>>>
>>> I don't think we have to phrase it in this warning way. Just say that
>>> volatile expressions are evaluated at the time of the DDL statement.
>>
>> OK, then just this:
>>
>> + Even volatile expressions such as
>> + <literal><function>CURRENT_TIMESTAMP</function></literal> can be used.
>
> I agree to not to phrase in a warning way, but it seems
> too-simplified. I think the reason is still required, like this?:
>
> ===
> The expression is evaluated once at the table creation time so it
> can involve even volatile expressions such as
> <literal><function>CURRENT_TIMESTAMP</function></literal>.

Ah, that's perhaps a better way of describing this feature.

Attached rebased patch containing above change.

Thanks,
Amit

Attachment Content-Type Size
v10-0001-Allow-generalized-expression-syntax-for-partitio.patch text/plain 35.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro HORIGUCHI 2019-01-24 10:44:28 Re: Use an enum for RELKIND_*?
Previous Message Amit Kapila 2019-01-24 10:19:23 Re: WIP: Avoid creation of the free space map for small tables