It is currently Thu Sep 09, 2010 2:00 am




Post new topic Reply to topic  [ 2 posts ] 
Bugfix for SAMPLE POSTGRESQL.5 
Author Message
User avatar

Joined: Wed Dec 17, 2008 2:31 am
Posts: 107
Location: Lünen, Germany
Post Bugfix for SAMPLE POSTGRESQL.5
Hello,

the sample-file SAMPLES\POSTGRESQL.5\tstpgrdd.prg throws a syntax error in the line
Code:
use "select <fields,...> from <table> order by <same order as dbf>" alias <table> via "pgrdd" connection nConn


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/harbour/2007-October/003857.html

Master Roberto, please be so kind as to add the following definition to the top of the program file.

Code:
#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)> )]


There was another slight problem with the file in the line
Code:
   nConn := dbpgconnection( "<host>;<database>;<user>;<password>;<port>;<scheme>" )


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
Code:
   nConn := dbpgconnection( "<host>;<database>;<user>;<password>" )


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


Sat Feb 06, 2010 10:54 am
Profile
HMG Founder
User avatar

Joined: Wed Jul 30, 2008 6:43 pm
Posts: 2324
Post Re: Bugfix for SAMPLE POSTGRESQL.5
raumi75 wrote:
<...>
Master Roberto, please be so kind as to add the following definition to the top of the program file.
<...>


Thanks. I'll check it ASAP.

_________________
Regards/Saludos,

Roberto


(Veritas Filia Temporis)


Sat Feb 06, 2010 1:14 pm
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © phpBB Group.
Designed by Vjacheslav Trushkin for Free Forum/DivisionCore.