public inbox for [email protected]  
help / color / mirror / Atom feed
From: Alvaro Herrera <[email protected]>
To: Pg Docs <[email protected]>
Subject: retroactive pg10 relnotes: sequence changes
Date: Tue, 28 Aug 2018 13:34:08 -0300
Message-ID: <[email protected]> (raw)

Hello

A customer of ours was taken by surprise by a change in Postgres 10 on a
trial upgrade from 9.6.  They were using sequences from SERIAL columns a
little unorthodoxly, and their stuff stopped working: essentially, they
hacked the default expression so that it'd automatically use negative
numbers when the sequence reached INT_MAX.  Since pg10 changed sequences
to stop emitting values at that point, it raised an error rather than
emit the negative numbers.

(In 9.6 and prior, the sequence would emit values past INT_MAX; it was
the column that raised the error.  In pg10 things were changed so that
it is now the sequence that raises the error.)

My proposal now is to document this issue in the Postgres 10 release
notes.  "It's a little late for that!" I hear you say, but keep this in
mind: many users have *not* yet upgraded to 10, and they'll keep doing
it for years to come still.  So I disagree that now is too late.  We
failed to warn people that already upgraded, but we're still on time to
alert people yet to upgrade.

I attach both the patch and a screenshot to show how minor the visual
effect of the change is.

(If people hate this, another option is to make it a separate bullet
point.)

-- 
Álvaro Herrera

diff --git a/doc/src/sgml/release-10.sgml b/doc/src/sgml/release-10.sgml
index 968ed866c2..f1dc816278 100644
--- a/doc/src/sgml/release-10.sgml
+++ b/doc/src/sgml/release-10.sgml
@@ -4717,6 +4717,13 @@ Branch: REL_10_STABLE [5159626af] 2017-11-03 14:14:16 -0400
      </para>
 
      <para>
+      Also, sequences created for <literal>SERIAL</literal> columns now
+      generate positive 32-bit wide values rather than 64-bit, as they
+      used to.  (This has no visible effect if the values are just stored in
+      the column.)
+     </para>
+
+     <para>
       The output of <application>psql</application>'s <command>\d</command> command for a
       sequence has been redesigned, too.
      </para>


Attachments:

  [text/plain] sequences-10.patch (710B, 2-sequences-10.patch)
  download | inline diff:
diff --git a/doc/src/sgml/release-10.sgml b/doc/src/sgml/release-10.sgml
index 968ed866c2..f1dc816278 100644
--- a/doc/src/sgml/release-10.sgml
+++ b/doc/src/sgml/release-10.sgml
@@ -4717,6 +4717,13 @@ Branch: REL_10_STABLE [5159626af] 2017-11-03 14:14:16 -0400
      </para>
 
      <para>
+      Also, sequences created for <literal>SERIAL</literal> columns now
+      generate positive 32-bit wide values rather than 64-bit, as they
+      used to.  (This has no visible effect if the values are just stored in
+      the column.)
+     </para>
+
+     <para>
       The output of <application>psql</application>'s <command>\d</command> command for a
       sequence has been redesigned, too.
      </para>


  [image/png] sequences.png (64.5K, 3-sequences.png)
  download | view image

view thread (6+ messages)  latest in thread

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: retroactive pg10 relnotes: sequence changes
  In-Reply-To: <[email protected]>

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

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