Bugfix for SAMPLE POSTGRESQL.5
Posted: Sat Feb 06, 2010 10:54 am
Hello,
the sample-file SAMPLES\POSTGRESQL.5\tstpgrdd.prg throws a syntax error in the line
At first I thought, I was too stupid to fill in the correct parameters, but then I found the bugfix in another forum:
http://www.matrixlist.com/pipermail/har ... 03857.html
Master Roberto, please be so kind as to add the following definition to the top of the program file.
There was another slight problem with the file in the line
When I explicitly defined the port-number, the connection was refused and the error message asked, if the postgresql-server was listening on port 0. After I left out the port-number and the scheme, everything was fine. The default port number 5432 and scheme "public" was used.
I could not find any documentation on the pgrdd-driver, so I don't know how to fix this other than to leave out port and scheme and alter the line to
This should work for everybody who uses default port and scheme.
Applying those to changes to the sample file will be a big leap forward for others, who try to connect to postgresl-servers.
Thank you very much and have a great weekend!
Raumi75
the sample-file SAMPLES\POSTGRESQL.5\tstpgrdd.prg throws a syntax error in the line
Code: Select all
use "select <fields,...> from <table> order by <same order as dbf>" alias <table> via "pgrdd" connection nConn
http://www.matrixlist.com/pipermail/har ... 03857.html
Master Roberto, please be so kind as to add the following definition to the top of the program file.
Code: Select all
#command USE <(db)> [VIA <rdd>] [ALIAS <a>] [<nw: NEW>] ;
[<ex: EXCLUSIVE>] [<sh: SHARED>] [<ro: READONLY>] ;
[CODEPAGE <cp>] [CONNECTION <nConn>] [INDEX <(index1)> [, <(indexN)>]] => ;
dbUseArea( <.nw.>, <rdd>, <(db)>, <(a)>, ;
if(<.sh.> .or. <.ex.>, !<.ex.>, NIL), <.ro.>, [<cp>], [<nConn>] ) ;
[; dbSetIndex( <(index1)> )] ;
[; dbSetIndex( <(indexN)> )]
Code: Select all
nConn := dbpgconnection( "<host>;<database>;<user>;<password>;<port>;<scheme>" )
I could not find any documentation on the pgrdd-driver, so I don't know how to fix this other than to leave out port and scheme and alter the line to
Code: Select all
nConn := dbpgconnection( "<host>;<database>;<user>;<password>" )
Applying those to changes to the sample file will be a big leap forward for others, who try to connect to postgresl-servers.
Thank you very much and have a great weekend!
Raumi75