Re: functions with side effect - Mailing list pgsql-general

From Laurenz Albe
Subject Re: functions with side effect
Date
Msg-id 1532010452.2387.1.camel@cybertec.at
Whole thread Raw
In response to functions with side effect  (Torsten Förtsch <tfoertsch123@gmail.com>)
List pgsql-general
Torsten Förtsch wrote:
> assuming 
> 
> SELECT nextval('s'), currval('s');
> 
> or
> 
> SELECT * FROM (VALUES (nextval('s'), currval('s'))) t;
> 
> is there any guarantee that the 2 output values are the same?

You can use at EXPLAIN (VERBOSE) output to see if it will work
in this special case, but I wouldn't depend on it in general.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com


pgsql-general by date:

Previous
From: Torsten Förtsch
Date:
Subject: functions with side effect
Next
From: Tom Lane
Date:
Subject: Re: cache lookup failed for attribute 1 of relation XXXXXX