GDA: empty PostgreSQL table failed workaround

Derek Atkins warlord at MIT.EDU
Wed Feb 13 13:18:11 EST 2008


Phil Longstaff <plongstaff at> writes:

> Saving to the db deletes all tables and then recreates them.  It 
> therefore deleted the slot_id without the default value.  It wouldn't 
> have touched the sequence.  I'll need to build your workaround into a 
> rev and then let you try it.  There's also an argument to be made that I 
> should create some test cases and set up automated tests for sqlite, 
> mysql and psql.  Maybe once I'm over these initial hurdles and some 
> people are working with the code.
> Yes, the recurrence table would have the same problem.  All of the other 
> tables are for objects which have a guid as the main reference (and 
> therefore as the table's primary key).  Slots and recurrences attach to 
> an object but there can be more than one attached to any object.

I'm sure this is going to display my utter lack of knowledge about
DB systems, but...  Why do you need a slot_id or recurrence_id column
at all?  I would think that you would always just do something like:

  select * from slots where slot_guid=<object guid>


  delete from slots where slot_guid=<object guid>
  insert into slots values (...)

Yeah, this isn't quite as nice as using an update, but it certainly
works.  I could imagine a similar thing for the Recurrence table.

Thanks for your indulgence...

> Phil


       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL:    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available

More information about the gnucash-devel mailing list