[Newbies] Postgress Database connection
cdrick65 at gmail.com
Tue May 9 17:56:22 UTC 2006
Hi Shaun :)
I'm a newbie too; but I have had success connecting to remote PG72
> DBs using Yanni Chiu's postgres client in Squakmap.
> Here is some example code that works for me:
> PGConnection defaultConnectionArgs
> userName: '*******';
> password: '******';
> hostname: 'p-db-002';
> databaseName: 'trac'.
> | db |
> Transcript cr; show: 'Connecting to postgres'; cr.
> db := PGConnection new.
> (db startup; isConnected) ifTrue: [ | results |
> results := db execute: 'select firstname, lastname from
> results rows do: [ :row | | data |
> data := row dataKeyedByFieldName.
> Transcript show: 'First: ''', (data at: 'firstname') ,
> ''''; cr.
> Transcript show: 'Last: ''', (data at: 'lastname') , '''';
> cr; cr].
> db terminate].
Thanks for your code ;)
Actually, I found some problem but that was in the remote database...
I had an error message in the write buffer and I got an equivalent from my
== psql: FATAL: Fichier pg_hba.conf manquant ou erroné
== HINT: Voir les traces du serveur pour plus de détails.
pg_hba.conf is missing or with errors ! I'll hope this is only that...
It's postgress 7.4.7-6 sarge :)
ps: for odbc, drivers have to be downloaded (from postgres) ...
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners