BUG #13735: pg_get_serial_sequence can be incorrect
От | colin.knox@offers.com |
---|---|
Тема | BUG #13735: pg_get_serial_sequence can be incorrect |
Дата | |
Msg-id | 20151026185840.3033.6529@wrigleys.postgresql.org обсуждение исходный текст |
Ответы |
Re: BUG #13735: pg_get_serial_sequence can be incorrect
|
Список | pgsql-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.
В списке pgsql-bugs по дате отправления: