Re: using expression syntax for partition bounds - Mailing list pgsql-hackers

From Amit Langote
Subject Re: using expression syntax for partition bounds
Date
Msg-id cf023fdf-0f98-3aca-7354-389ab2f4c8fc@lab.ntt.co.jp
Whole thread Raw
In response to Re: using expression syntax for partition bounds  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
Responses Re: using expression syntax for partition bounds  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List 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

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: WIP: Avoid creation of the free space map for small tables
Next
From: Kyotaro HORIGUCHI
Date:
Subject: Re: Use an enum for RELKIND_*?