Re: [SQLObject] test_sqlobject.py fails on Postgres 7.2
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Ian B. <ia...@co...> - 2004-12-03 20:16:05
|
Oleg Broytmann wrote: > Hello! > > ProgrammingError: ERROR: Relation 'test_s_o1_id_seq' already exists > > I found the cause for this. In 7.2 DROP TABLE drops the table and all > indicies but not sequences. > > $ psql test > test=# \d > List of relations > Name | Type | Owner > ------------------+----------+------- > test_s_o1 | table | phd > test_s_o1_id_seq | sequence | phd > (2 rows) > > test=# DROP TABLE test_s_o1; > DROP > test=# \d > List of relations > Name | Type | Owner > ------------------+----------+------- > test_s_o1_id_seq | sequence | phd > (1 row) > > > Can anybody running Postgres 7.3+ confirm whether it drops sequences on > DROP TABLE? On 7.4 it seems to drop the sequence when I do: CREATE TABLE test_table ( id SERIAL PRIMARY KEY ); SELECT nextval('test_table_id_seq'); DROP TABLE test_table CASCADE; SELECT nextval('test_table_id_seq'); I get an error on the second nextval. I don't have a 7.3 server around, but I'm guessing it will act the same as 7.4 on this. -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |