Обсуждение: BUG #10526: bad sequence rename

Поиск
Список
Период
Сортировка

BUG #10526: bad sequence rename

От
gnuplanet@gmail.com
Дата:
The following bug has been logged on the website:

Bug reference:      10526
Logged by:          Alexey
Email address:      gnuplanet@gmail.com
PostgreSQL version: 9.3.4
Operating system:   Debian GNU/Linux
Description:

xxx=> create sequence a;
CREATE SEQUENCE
xxx=> alter sequence a rename to b;
ALTER SEQUENCE
xxx=> select sequence_name from b;
 sequence_name
---------------
 a
(1 row)
xxx=> select version();
                                           version

----------------------------------------------------------------------------------------------
 PostgreSQL 9.3.4 on x86_64-unknown-linux-gnu, compiled by gcc (Debian
4.8.3-2) 4.8.3, 64-bit
(1 row)

Re: BUG #10526: bad sequence rename

От
Vik Fearing
Дата:
On 06/04/2014 01:16 PM, gnuplanet@gmail.com wrote:
> xxx=> create sequence a;
> CREATE SEQUENCE
> xxx=> alter sequence a rename to b;
> ALTER SEQUENCE
> xxx=> select sequence_name from b;
>  sequence_name
> ---------------
>  a
> (1 row)
> xxx=> select version();
>                                            version
>
> ----------------------------------------------------------------------------------------------
>  PostgreSQL 9.3.4 on x86_64-unknown-linux-gnu, compiled by gcc (Debian
> 4.8.3-2) 4.8.3, 64-bit
> (1 row)

This is a duplicate of bug #7920.  The decision on that was to do nothing:
http://www.postgresql.org/message-id/14588.1362580075@sss.pgh.pa.us
--
Vik

Re: BUG #10526: bad sequence rename

От
Tom Lane
Дата:
gnuplanet@gmail.com writes:
> xxx=> create sequence a;
> CREATE SEQUENCE
> xxx=> alter sequence a rename to b;
> ALTER SEQUENCE
> xxx=> select sequence_name from b;
>  sequence_name
> ---------------
>  a
> (1 row)

This is not a bug; it's just how sequences work.

20-20 hindsight would suggest that the sequence name should never have
been included in the sequence data at all, but it's there and it will
always represent the original sequence name.

            regards, tom lane