probably a bug of data-type serial

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


recently I tried the following using my psql-client:

select version();
                            version
---------------------------------------------------------------
 PostgreSQL 7.1.2 on i686-pc-linux-gnu, compiled by GCC 2.95.2
(1 row)




create table test_serial (number serial,atext varchar (10) not null);

insert into test_serial (atext) values ('A');
insert into test_serial (atext) values ('B');
insert into test_serial (atext) values (null);
insert into test_serial (atext) values ('C');

SELECT * from test_serial ;
 zahl | eintext
------+---------
    1 | A
    2 | B
    4 | C
(3 rows)



\ds
                   List of relations
              Name               |   Type   |  Owner
---------------------------------+----------+----------
 test_serial_number_seq          | sequence | postgres



drop table test_serial;

select * from test_serial ;
ERROR:  Relation 'test_serial' does not exist


\ds
                   List of relations
              Name               |   Type   |  Owner
---------------------------------+----------+----------
 test_serial_number_seq          | sequence | postgres





************************************************************************************************************************************

First question:
The example shows that the column number of type serial is incremented
as if the preceding insert-statement was successfull, even if it was
not.
Are the values for the column number of type serial inserted into the
corresponding
sequence before the attempt to insert into the table and are not deleted
if the
latter fails ?
But maybe this behaviour was intended to log succcessless attempts to
insert into the table.

Second question:
The SEQUENCE corresponding to a column of type serial is not beeing
droped
automatically when the table containing the serial-column is droped.
Does it make sense to store a sequence without a corresponding table ?




with best regards

Ralf Miller
--
Wir würden uns freuen, Sie vom 15. bis 19. Oktober 2001 auf der Systems
in München, Halle B6 Stand 321, begrüßen zu dürfen.
---------------------------------------------------------------------------
Ralf Miller
Topnet-AG
Telefon 0211-53087-244

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Orion
Дата:
Сообщение: Index Scans Oddness
Следующее
От: Orion
Дата:
Сообщение: Cant get planner to use index (7.1.3-1PGDG)