From: val.janeiko@gmail.com
To: 'David G. Johnston' <david.g.johnston@gmail.com>
To: pgsql-bugs@lists.postgresql.org
Subject: RE: BUG #16430: Sequence with cache > 1 makes it increment by number specified as cache
Date: Tue, 12 May 2020 23:56:23 +0100
Message-ID: <000401d628b0$8f5bedd0$ae13c970$@gmail.com> (raw)
In-Reply-To: <CAKFQuwYeiR4WUg_3+=qrigDF=BfW1bsfD1tGf_Xs0Mj-R5koeQ@mail.gmail.com>
References: <16430-f03b90a57994b00f@postgresql.org>
<CAKFQuwYeiR4WUg_3+=qrigDF=BfW1bsfD1tGf_Xs0Mj-R5koeQ@mail.gmail.com>
I am not sure. I was porting MS SQL code to Postgre. (I assumed it works in MS SQL, but I haven’t checked, might be a bug)
But now that I know that this cache is not shared between connections it does not make sense to have cache more than max value (80k).
-Valentinas
From: David G. Johnston <david.g.johnston@gmail.com>
Sent: 12 May 2020 16:48
To: val.janeiko@gmail.com; pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16430: Sequence with cache > 1 makes it increment by number specified as cache
On Tuesday, May 12, 2020, PG Bug reporting form <noreply@postgresql.org <mailto:noreply@postgresql.org> > wrote:
The following bug has been logged on the website:
Bug reference: 16430
Logged by: Valentinas
Email address: val.janeiko@gmail.com <mailto:val.janeiko@gmail.com>
PostgreSQL version: 12.2
Operating system: Alpine (container)
Description:
When using Sequence inside a plpgsql function called using SELECT func()
using Npgsql library a sequence is incremented by the value specified in
CACHE.
That is a perfectly valid outcome per the meaning and documented usage of cache in the server.
Additionally if CACHE is set to > 80000 (e.g. 100000) the query always
returns 0.
Interesting...probably worth looking into even if a cache value that large doesn’t make much sense usually. Doing and posting some tests using just sql and psql would be a good start in isolating where the discrepancy lies.
David J.
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: val.janeiko@gmail.com, david.g.johnston@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: RE: BUG #16430: Sequence with cache > 1 makes it increment by number specified as cache
In-Reply-To: <000401d628b0$8f5bedd0$ae13c970$@gmail.com>
* 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