Re: BUG #13735: pg_get_serial_sequence can be incorrect

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: colin(dot)knox(at)offers(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #13735: pg_get_serial_sequence can be incorrect
Date: 2015-10-26 22:33:50
Message-ID: 4800.1445898830@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

colin(dot)knox(at)offers(dot)com writes:
> 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.

Quite, and that's its documented behavior:

pg_get_serial_sequence returns the name of the sequence associated with a
column ... This association can be modified or removed with ALTER SEQUENCE
OWNED BY. (The function probably should have been called
pg_get_owned_sequence; its current name reflects the fact that it's
typically used with serial or bigserial columns.)

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Noah Misch 2015-10-27 07:20:24 Re: Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')
Previous Message Felipe Gasper 2015-10-26 22:17:16 Re: BUG #13736: pg_dump should use E'' quotes