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 PostgreSQL equivalent 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 add to 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




-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to