pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #17112: Sequence number is not restored when the stored procedure ends abnormally
3+ messages / 3 participants
[nested] [flat]

* BUG #17112: Sequence number is not restored when the stored procedure ends abnormally
@ 2021-07-16 02:39 PG Bug reporting form <noreply@postgresql.org>
  2021-07-16 07:59 ` Re: BUG #17112: Sequence number is not restored when the stored procedure ends abnormally Sergei Kornilov <sk@zsrv.org>
  0 siblings, 1 reply; 3+ messages in thread

From: PG Bug reporting form @ 2021-07-16 02:39 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: inconvenience.notice@gmail.com

The following bug has been logged on the website:

Bug reference:      17112
Logged by:          Yuetsuro Kobayashi
Email address:      inconvenience.notice@gmail.com
PostgreSQL version: 13.3
Operating system:   Windows 10 Pro
Description:        

When process was abnormal ends by a stored procedure processing problem, the
table processing is restored, but sequence number remains incremented and is
not restored.



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #17112: Sequence number is not restored when the stored procedure ends abnormally
  2021-07-16 02:39 BUG #17112: Sequence number is not restored when the stored procedure ends abnormally PG Bug reporting form <noreply@postgresql.org>
@ 2021-07-16 07:59 ` Sergei Kornilov <sk@zsrv.org>
  2021-07-16 09:22   ` Re: BUG #17112: Sequence number is not restored when the stored procedure ends abnormally Francisco Olarte <folarte@peoplecall.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Sergei Kornilov @ 2021-07-16 07:59 UTC (permalink / raw)
  To: inconvenience.notice@gmail.com <inconvenience.notice@gmail.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>

Hello

Exactly as expected. It's intentional and not a bug. Sequences are guaranteed to be unique.

regards, Sergei





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #17112: Sequence number is not restored when the stored procedure ends abnormally
  2021-07-16 02:39 BUG #17112: Sequence number is not restored when the stored procedure ends abnormally PG Bug reporting form <noreply@postgresql.org>
  2021-07-16 07:59 ` Re: BUG #17112: Sequence number is not restored when the stored procedure ends abnormally Sergei Kornilov <sk@zsrv.org>
@ 2021-07-16 09:22   ` Francisco Olarte <folarte@peoplecall.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Francisco Olarte @ 2021-07-16 09:22 UTC (permalink / raw)
  To: Sergei Kornilov <sk@zsrv.org>; +Cc: inconvenience.notice@gmail.com <inconvenience.notice@gmail.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>

Sergei:

On Fri, Jul 16, 2021 at 9:59 AM Sergei Kornilov <sk@zsrv.org> wrote:
> Exactly as expected. It's intentional and not a bug. Sequences are guaranteed to be unique.

I would add "but NOT guaranteed to be continuous ( gapless ) or
strictly growing among different connections", which seems to be the
behaviour OP is complaining about.

For the OP:

This means you can get 1,3,5 ( not continuous ) or, if using two
connections, A and B, you can get ( time ordered ) 1 in a, 3 in b, 2
in A, 4 in b,....( A backend/connection can grab a chunk and serve
numbers from it to its clients, chunks will not overlap, this
behaviour can be observed if A and B grab two numbers chunks  )

It also means sequences can not be used for things like bill numbers
in spain ( which must be growing and gapless ), in case you are using
them for something like that.  It is done this way to improve
concurrency / speed for their intended usage of generating synthetic
PKs and similar stuff ( if you do it strictlly growing, like my bill
numbers stuff, once someone gets a number everyone else needing them
must be stopped until it commits or rolls back ).

Francisco Olarte.





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2021-07-16 09:22 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-07-16 02:39 BUG #17112: Sequence number is not restored when the stored procedure ends abnormally PG Bug reporting form <noreply@postgresql.org>
2021-07-16 07:59 ` Sergei Kornilov <sk@zsrv.org>
2021-07-16 09:22   ` Francisco Olarte <folarte@peoplecall.com>

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