pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: pgsql-committers@postgresql.org
Subject: Re: pgsql: Add pg_sequence system catalog
Date: Tue, 20 Dec 2016 12:51:32 -0500
Message-ID: <87e0c1ae-d909-ec17-289c-2064747343da@2ndquadrant.com> (raw)
In-Reply-To: <dc80c30a-10bc-7c80-7a2f-7c17c0fbd742@2ndquadrant.com>
References: <E1cJKgv-0004eC-KE@gemulon.postgresql.org>
	<76ce2ca3-40f2-d291-eae2-17b599f29ba0@2ndquadrant.com>
	<dc80c30a-10bc-7c80-7a2f-7c17c0fbd742@2ndquadrant.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

On 12/20/16 11:12 AM, Peter Eisentraut wrote:
> create table test1 (id serial, t text);
> ERROR:  MINVALUE (4294967296) must be less than MAXVALUE (-4294967296)
> 
> Normal sequence creation works.
> 
> I think this error comes from the ALTER SEQUENCE OWNED BY call that the
> serial column creation synthesizes.  This would read the existing
> sequence parameters from the catalog (AlterSequence()), then parse the
> parameters (init_params()), where nothing changes except the owner.  It
> still runs the crosscheck min/max, which produces the error message.
> The values complained about are 0x100000000 and 0xFFFFFFFF00000000, so
> it's possible that it's reading the catalog off by 4 bytes or some bytes
> are flipped somewhere else.

It looks like the catalog data is written without padding (relid(4),
start(8), inc(8), max(8), min(8), ...) but read with padding (relid(4),
padding(4), start(8), inc(8), max(8), min(8), ...).  The difference is
that the write goes through heap_form_tuple but the read uses the Form_
struct.  What is suspicious is this from the configure output:

checking alignment of short... 2
checking alignment of int... 4
checking alignment of long... 4
checking alignment of long long int... 8
checking alignment of double... 4

We use DOUBLEALIGN to align int64 values, but on this platform, that is
not correct.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



view thread (11+ messages)  latest in thread

Message-ID: <87e0c1ae-d909-ec17-289c-2064747343da@2ndquadrant.com>
Permalink:  ../87e0c1ae-d909-ec17-289c-2064747343da@2ndquadrant.com/
Also on:    postgresql.org/message-id/87e0c1ae-d909-ec17-289c-2064747343da@2ndquadrant.com

 · 

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-committers@postgresql.org
  Cc: peter.eisentraut@2ndquadrant.com
  Subject: Re: pgsql: Add pg_sequence system catalog
  In-Reply-To: <87e0c1ae-d909-ec17-289c-2064747343da@2ndquadrant.com>
  References: <E1cJKgv-0004eC-KE@gemulon.postgresql.org> <76ce2ca3-40f2-d291-eae2-17b599f29ba0@2ndquadrant.com> <dc80c30a-10bc-7c80-7a2f-7c17c0fbd742@2ndquadrant.com> <87e0c1ae-d909-ec17-289c-2064747343da@2ndquadrant.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