Parallel safety of CURRENT_* family - Mailing list pgsql-hackers

From
Subject Parallel safety of CURRENT_* family
Date
Msg-id 937ac7744dee7956324d43149b821538e357@guerrillamail.com
Whole thread Raw
Responses Re: Parallel safety of CURRENT_* family  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hello

How should I mark a function which calls CURRENT_DATE? Parallel safe or parallel restricted?

pg_proc shows that now() is marked as restricted, but transaction_timestamp() is marked as safe.

The manual (https://www.postgresql.org/docs/9.6/static/functions-datetime.html) says that "now() is a traditional
PostgreSQLequivalent to transaction_timestamp()" and "transaction_timestamp() is equivalent to CURRENT_TIMESTAMP". 

The code seems to confirm: GetSQLCurrentDate(), GetSQLCurrentTimestamp() and now() all invoke the same
GetCurrentTransactionStartTimestamp().

It looks like that functions which uses the CURRENT_* family of functions should be marked as restricted (something to
addto the docs) and that transaction_timestamp() is incorrectly marked as safe. 

Am I wrong?

Mark Kolar





----
Sent using Guerrillamail.com
Block or report abuse: https://www.guerrillamail.com/abuse/?a=UUZnFAFNS7UWgwum414PfQfTStiVwcZciatQew%3D%3D





pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [HACKERS] Re: [HACKERS] 答复: [HACKERS] postgres 1 个(共 2 个) can pg 9.6 vacuum freeze skip page on index?
Next
From: Tom Lane
Date:
Subject: Re: pgbench - allow backslash continuations in \set expressions