pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: colin.knox@offers.com
To: pgsql-bugs@postgresql.org
Subject: BUG #13735: pg_get_serial_sequence can be incorrect
Date: Mon, 26 Oct 2015 18:58:40 +0000
Message-ID: <20151026185840.3033.6529@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      13735
Logged by:          Colin Knox
Email address:      colin.knox@offers.com
PostgreSQL version: 9.4.1
Operating system:   OSX
Description:        

If you create a table with a serial column, pg_get_serial_sequence will
accurately name the sequence that was created along with it.

If you create a NEW sequence object, and "alter table FOO alter column id
set default nextval('NEW_SEQUENCE'::regclass);,  then pg_get_serial_sequence
will still return the name of the original sequence.

You can alter the new sequence and SET OWNER to fix this behavior; but you
can break it again by altering the original sequence and setting owner to
NONE, and then back to table.column.     

Basically, pg_get_serial_sequence does not actually check the default value
in the table, it only checks the most recent sequence to have declared
itself owned by that column, regardless of what sequence is actually in use.


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



view thread (2+ messages)  latest in thread

Message-ID: <20151026185840.3033.6529@wrigleys.postgresql.org>
Permalink:  ../20151026185840.3033.6529@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20151026185840.3033.6529@wrigleys.postgresql.org

 · 

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-bugs@postgresql.org
  Cc: colin.knox@offers.com
  Subject: Re: BUG #13735: pg_get_serial_sequence can be incorrect
  In-Reply-To: <20151026185840.3033.6529@wrigleys.postgresql.org>
  References: <20151026185840.3033.6529@wrigleys.postgresql.org>

* 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