pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Torsten Förtsch <tfoertsch123@gmail.com>
To: PostgreSQL mailing lists <pgsql-general@postgresql.org>
Subject: Re: functions with side effect
Date: Thu, 19 Jul 2018 16:27:32 +0200
Message-ID: <1532010452.2387.1.camel@cybertec.at> (raw)
In-Reply-To: <CAKkG4_=MTjK6bAJDLM8brKR+U6JggZNhEta6nXgANUyWo8VcDA@mail.gmail.com>
References: <CAKkG4_=MTjK6bAJDLM8brKR+U6JggZNhEta6nXgANUyWo8VcDA@mail.gmail.com>

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




view thread (9+ messages)  latest in thread

Message-ID: <1532010452.2387.1.camel@cybertec.at>
Permalink:  ../1532010452.2387.1.camel@cybertec.at/
Also on:    postgresql.org/message-id/1532010452.2387.1.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, tfoertsch123@gmail.com
  Subject: Re: functions with side effect
  In-Reply-To: <1532010452.2387.1.camel@cybertec.at>
  References: <CAKkG4_=MTjK6bAJDLM8brKR+U6JggZNhEta6nXgANUyWo8VcDA@mail.gmail.com> <1532010452.2387.1.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox