From: Bud P. B. <bu...@si...> - 2003-05-14 16:44:27
|
I would like to bring up two Postgres questions/issues: Q1: Table Dropping and left-over sequences: -------------------------------------------- I found the following <quote src=http://www.phpbuilder.com/columns/tim20000705.php3:> At this point, I ran into another small issue with Postgres - its "serial" data type (the equivalent of MySQL's auto_increment) creates a "sequence" which does not get dropped when its parent table is dropped. So if you try to re-create the table, you'll get a name conflict for this sequence. A lot of new users would be confused by this, so Postgres loses a couple points for that. Also, MySQL is "smart" enough to increment its auto_increment value when you import data, whereas Postgres' sequence does not get reset when you import data, causing all new inserts to fail. </quote> Does that mean that the dropTable method of SQLObject should also drop the sequences? Q2: Global sequence possible? ----------------------------- I was thinking of having IDs that are unique across tables--something useful when thinking of implementing inheritance etc. So I tried to create a global sequence and have the id columns of several tables use it for their default values (DEFAULT nextval('global_oid_seq')). But that seems to fail. Can there be only a single column (of a single table) associated with a sequence??? many thanks --b /----------------------------------------------------------------- | Bud P. Bruegger, Ph.D. | Sistema (www.sistema.it) | Via U. Bassi, 54 | 58100 Grosseto, Italy | +39-0564-411682 (voice and fax) \----------------------------------------------------------------- |