#1015: tg-admin sql create failing due to missing tables (constraint creation
failure)
-----------------------+----------------------------------------------------
 Reporter:  mcfletch   |       Owner:  anonymous
     Type:  defect     |      Status:  new      
 Priority:  normal     |   Milestone:           
Component:  SQLObject  |     Version:  0.9a6    
 Severity:  normal     |    Keywords:           
-----------------------+----------------------------------------------------
 The ''tg-admin sql create'' function is failing for my schema.  It appears
 that the code is attempting to run each table's full set of SQL statements
 in alphabetical order, that is, it runs all statements for a table
 starting with 'a', *including constraint creation*, before it starts on
 the tables starting with 'b'.  Cases where a table is depended upon by
 following tables fail with
 {{{
 psycopg.ProgrammingError: ERROR:  relation "config_type" does not exist
 }}}
 where "config_type" is referenced by "config", for example.

 Contrast that with ''tg-admin sql sql'' behavior (which pushes all
 constraint creation until after the tables have been created).

 Fix is either to restructure the ''tg-admin sql create'' function to
 collect the constraints until the end (as with the ''tg-admin sql sql''
 function) or to use a topological sort to create tables in dependency-
 aware order (which will only get you so far if you have circular
 dependencies, at which point you'll need to delay dependency setup
 anyway).  Given the current structure I'd suggest mimicing the operation
 of ''tg-admin sql sql'' would be the more reasonable approach.

 In the meantime, workaround is to direct ''tg-admin sql sql'' to a
 temporary file and use that to create the database.

 SQLObject-0.8dev_r1814-py2.4.egg (with patches to fix missing tables and
 semicolons)
 TurboGears-0.9a6-py2.4.egg

-- 
Ticket URL: <http://trac.turbogears.org/turbogears/ticket/1015>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Tickets" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-tickets
-~----------~----~----~----~------~----~------~--~---

Reply via email to