[Newbies] Postgress Database connection
cdrick
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
> employee;'.
> 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
shell :s
== 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 :)
see you
Cédrick
ps: for odbc, drivers have to be downloaded (from postgres) ...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20060509/f66492aa/attachment-0001.htm
More information about the Beginners
mailing list