Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

[mv] MV4 beta 1: bug when creating multiple SQL tables with sequences



******    message to minivend-users from Mark Stosberg <mark@summersault.com>     ******


Hello,

  I'm using Minivend 4 beta 1 to create several empty SQL based tables.
I'm using Postgres and am using the type "serial" to cause Postgres to
create a sequence for the primary key. 
  Minivend appears to create a table called "mv_test_create" before it
creates each real table. The bug is that the sequence
'mv_test_create_id_seq'; does not get deleted when the test table gets
deleted. When creating multiple tables, Minivend fails on the second
table because this sequence already exists. 

This bug may be specific to Postgres (I'm using 6.5.3). When the serial
field is used, Postgres creates a sequence named '<table>_<col>_seq'

It is not dropped automatically with the table, though. It has be
dropped explicitly like:
drop sequence <table>_<col>_seq;

To further confuse matters, once the column has been created, postgres
no longer identifies  it as a type of 'serial'. Instead, you see this description:

int4 not null default nextval('<table>_<col>_seq');

One fix for minivend is to catch this Postgres oddity. Another is have a
way in the catalog.cfg file to
create sequences  on their own (I didn't notice one..) 

It might also be more efficient if just one test table could be created
for a multiple table creation process. 

Further Postgres documention is at: http://www.postgresql.org/docs/

   -mark

  <<-------------------------------------------------------------->>
personal website                <    Summersault Website Design
   http://mark.stosberg.com/     >       http://www.summersault.com/
-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: