Patch suggestion for gnucash 1.8.8 (ports/finance/gnucash) postgres backend.

Joe Marcus Clarke marcus at marcuscom.com
Tue Jul 27 07:23:43 PDT 2004


On Mon, 2004-07-26 at 23:00, Richard Schilling wrote:
> I have created a patch that you can put into the "files" subdirectory of 
> the gnucash port.  It's attached.
> 
> Gnucash, when creating a database for the Postgres backend uses the 
> value returned from nl_langinfo(CODESET) to build up SQL queries.  In 
> particular the value returned from nl_langinfo(CODESET) is used to set 
> the encoding in the Postgres database in the following SQL command:
> 
>       CREATE DATABASE gnucash_database_name WITH ENCODING 'US-ASCII';
> 
> nl_langinfo(CODESET) returns the string "US-ASCII" on my BSD system. 
> When US-ASCII is used to build up SQL queries for the Postgres backend, 
> Postgres generates an error because "US-ASCII" is not allowed to be used 
> as an option in Postgres SQL.
> 
> Would you be willing to Patch the gnucash code to substitute US-ASCII 
> with SQL_ASCII as it is used?  The effected file is:
> 
> work/gnucash-1.8.8/src/backend/postgres/PostgresBackend.c, line 2100.

Committed, thanks.

Joe

> 
> 
> Thanks.
> 
> Richard Schilling
> (206) 774-5951
> 
> 
> 
> 
> ______________________________________________________________________
> *** src/backend/postgres/PostgresBackend.orig	Mon Jul 26 17:17:45 2004
> --- src/backend/postgres/PostgresBackend.c	Mon Jul 26 17:33:16 2004
> ***************
> *** 2104,2109 ****
> --- 2104,2114 ----
>            if (!strcmp (encoding, "ANSI_X3.4-1968"))
>              encoding = "SQL_ASCII";
>   
> +          if (!strcmp(encoding, "US-ASCII"))
> +            encoding = "SQL_ASCII";
> + 
> +          printf("\nDatabase encoding is: %s.\n", encoding);
> + 
>            /* create the database */
>            p = be->buff; *p =0;
>            p = stpcpy (p, "CREATE DATABASE ");
> 
> ______________________________________________________________________
> _______________________________________________
> freebsd-gnome at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-gnome
> To unsubscribe, send any mail to "freebsd-gnome-unsubscribe at freebsd.org"
-- 
PGP Key : http://www.marcuscom.com/pgp.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: This is a digitally signed message part
Url : http://lists.freebsd.org/pipermail/freebsd-gnome/attachments/20040727/bf791263/attachment.bin


More information about the freebsd-gnome mailing list