PostgreSQL & Freecoins

gnucash@cbbrowne.com gnucash@cbbrowne.com
Tue, 05 Nov 2002 23:38:09 -0500


> I've been working on a redesign, and am currently finishing up the data
> model, with only one or two entities remaining.  That said, however,
> it's never a good idea to access the data store directly, not when
> there's a good API to go through.

"Never" is a long time.

gnucash=# \d gncsummary 
                   View "gncsummary" 
   Column    |            Type             | Modifiers  
-------------+-----------------------------+----------- 
 num         | text                        |  
 description | text                        |  
 date_posted | timestamp without time zone |  
 accountname | text                        |  
 amount      | bigint                      |  
 value       | bigint                      |  
View definition: SELECT gnctransaction.num, gnctransaction.description, 
gnctransaction.date_posted\, gncaccount.accountname, gncentry.amount, 
gncentry.value FROM gncaccount, gnctransaction, gncentr\y WHERE 
((gncentry.transguid = gnctransaction.transguid) AND (gncaccount.accountguid = 
gncentry.ac\countguid));

I've found this view to be really rather useful...

Throw in a few useful views, and the SQL "view" becomes /really/ useful, 
getting rid of the need to manipulate irritating "guid" values...

This is the fundamental reason why PostgreSQL (and other "real" SQL DBMSes) 
are /spectacularly/ superior to MySQL which doesn't support things like views.
--
(reverse (concatenate 'string "gro.gultn@" "enworbbc"))
http://www3.sympatico.ca/cbbrowne/finances.html
This login session:  $13.99