Help getting postgres to work??

VW Fan vw_fan17@yahoo.com
Tue, 5 Jun 2001 20:04:01 -0700 (PDT)


I'm TRYING to get 1.5.98 to work with postgres. I've
managed to compile 1.5.98 on a RedHat 7.1 install with
a few updates (updating my Slackware 7.1 was going to
be a REAL pain :-(

I'm at the neophyte level when it comes to gnucash.
I've played only a little with postgres, but I'm
pretty experienced when it comes to SQL in general.. 

Anyway, I'm trying to save a file to a local postgres
db. I didn't see which versions of postgres were
supposed to be used, so I tried 2 versions: 7.0.8
(comes with RH 7.1) and 6.5.3-6 (the latest 6.5 I
could find), just in case.

In BOTH cases, it dies during setup of the new
database, and BOTH times, it's in the "CREATE
FUNCTION" block. 

With 7.0.8, it dies on the first one (header looks
like:
CREATE FUNCTION gncSubtotalBalance (CHAR(32),
DATETIME, DATETIME)
    RETURNS int8
    AS 'SELECT sum(gncEntry.value)


with the error:
Error: pgend_session_begin: finish query failed:
ERROR:  return type mismatch in function: declared to
return numeric, returns int8

It's definitely this function - cutting and pasting it
into psql returns the same error. The error is also
pretty obvious. I tried adding a *1.0 to the sum, and
that changed it from int8 to float8. I don't which
part to fix (i.e. change the return type to int8, or
change the function to actually return a numeric).

So, I tried 6.5. It dies at the same spot, with the
following error:
Info: pgend_session_begin: clearing result 0
Error: pgend_session_begin: finish query failed:
        ERROR:  parser: parse error at or near "("


I didn't have much idea where to start here, so I
thought I'd ask for help.

So, what am I doing wrong? I'm trying to save to:
postgres://localhost/testdb
_localhost_ is the literal string localhost, not my
hostname, 
_testdb_ is a database that does not already exist
(gnucash asks: do you want to create the database?)

Any hints would be appreciated.

(sorry for the yahoo address, had some problems
subscribing from my real address.)

Mattias Hembruch

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/