Postgres chagnes

Matthew Vanecek mevanecek at yahoo.com
Mon Aug 11 22:15:01 CDT 2003


On Mon, 2003-08-11 at 20:27, Linas Vepstas wrote:
> Hi,
> 
> I noticed that the postgres backend changed recently, and thought 
> to take a quick look. I spotted one obvious bug immediately:
> 
> Index: PostgresBackend.c
> ===================================================================
> RCS file: /home/cvs/cvsroot/gnucash/src/backend/postgres/PostgresBackend.c,v
> retrieving revision 1.48
> retrieving revision 1.49
> diff -u -p -r1.48 -r1.49
> --- PostgresBackend.c   27 Jul 2003 19:20:00 -0000      1.48
> +++ PostgresBackend.c   10 Aug 2003 20:24:24 -0000      1.49
> @@ -2204,10 +2204,10 @@ pgend_session_begin (QofBackend *backend
>                 qof_backend_set_error (&be->be, ERR_SQL_DB_BUSY);
>                 return;
>               }
> -             pgendUpgradeDB (be);
>               p = "COMMIT;\n";
>               SEND_QUERY (be,p, );
>               FINISH_QUERY(be->connection);
> +             pgendUpgradeDB (be);
>             }
>             else
>             {
> 
> Whoever did this cleary didn't look at what   pgendUpgradeDB (be);
> does: its a routine that automatically and transparently makes 
> the postgres backend upwards compatible with older versions ... 
> 

Yes, I did look at it.  Very carefully.  I modified upgrade.c
accordingly.  Leave it that way or suggest a better way.  Each upgrade
function has it's own transaction now, so the above call cannot be
inside another transaction.

> Also, *EVERY* change to upgrade.c is fundamentally incorrect !! 
> I REALLY WANT TO TYPE THE FOLLOWING IN CAPTIAL LETTERS:
> 

Yes, I know, I made a mistake there.  Was going to submit a patch to it
today.  The 1.8.x patch is correct--just haven't had a chance to get the
upgrade.c patch for HEAD in...

> You cannot change gncEntry to gncSplit in put_iguid_in_tables()
> (for example), because databases on which this routine would run 
> do not have tables which have column names called gncSplit!
> 

See above.  Oversight on my part, fixed it in 1.8.x branch patch, was
about to submit a patch, cool your britches...

-- 
Matthew Vanecek
perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'
********************************************************************************
For 93 million miles, there is nothing between the sun and my shadow except me.
I'm always getting in the way of something...



More information about the gnucash-devel mailing list