[PyKDE] Trouble with sql examples from Qt 3.x.

Hans-Peter Jansen hpj at urpla.net
Thu May 27 13:22:01 BST 2004


Hi Denis,

On Thursday 27 May 2004 09:46, Denis Bitouzé wrote:
>
> I created testdb database for user 'bitouze' who is a
> postgresql super-user and is allowed to create databases:
>
> [bitouze at drums SQL]$ psql -U bitouze template1 -f testdb_pg.sql

I've grabbed this sql script from trolltechs SQL examples..

> psql:testdb_pg.sql:141: ERROR:  invalid input syntax for type
> money: "$123,450.50" CONTEXT:  COPY staff, line 1, column salary:
> "$123,450.50" setval

Well, obviously pg doesn't like the currency format.

Two options, first you can try: 
LANG=C psql -U bitouze template1 -f testdb_pg.sql
If that fails also, remove the "$" and the thousand formatter ","
from all values. You may want to remove the incompleted test database 
beforehand.

> when I try:
>
> python dbconnect.py
>
> I get the following error message when cliking on 'OK':
>
> Cannot open testdb database on localhost!
>
> QMYSQL3: Unable to connect
> Unknown database 'testdb'

Please edit dbpar.py to fit your needs, or create a local_dbpar.py in 
that folder from dbpar.py. 

Note the DB_DRIVER parameter (you need QPSQL7 for pg).

Good luck,
Pete




More information about the PyQt mailing list