Re: COPY and Volatile default expressions

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: COPY and Volatile default expressions
Дата
Msg-id CA+U5nMJbmCw+dR5AEpr2M7vPkmVtBK2DKXOGMbD0BOKfn7n0og@mail.gmail.com
обсуждение исходный текст
Ответ на Re: COPY and Volatile default expressions  (Jaime Casanova <jaime@2ndquadrant.com>)
Ответы Re: COPY and Volatile default expressions  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-hackers
On 15 April 2013 21:32, Jaime Casanova <jaime@2ndquadrant.com> wrote:
> On Mon, Apr 15, 2013 at 3:21 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>
>> OTOH, the notion that a UUID generator doesn't touch *any* database
>> state seems like it might be worth treating as a general function
>> property: it's simple to understand and applies to a lot of other
>> volatile functions such as random() and clock_timestamp().
>>
>
> Something like the NO SQL access indication mandated by sql standard?
>
> http://www.postgresql.org/message-id/1267473390.7837.9.camel@vanquo.pezone.net

That would work for UUIDs, random() etc but not for sequences.

So I'll treat this as two separate cases:
* add special case for sequences
* use the NO SQL mechanism, as described, which implies no reads or
writes of database state. We could test that, but its somewhat harder
and we'd need to test for that on entry to any function, which I don't
much like.

Default to current timestamp is also a common use case - thanks for
mentioning that.

Doing it tha way Tatsuo would be able to parse functions more easily
as requested in the linked post.

--Simon Riggs                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



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

Предыдущее
От: Rodrigo Barboza
Дата:
Сообщение: Re: Query not using index for user defined type
Следующее
От: "anarazel@anarazel.de"
Дата:
Сообщение: Re: Why are JSON extraction functions STABLE and not IMMUTABLE?