Cedrick,

 

You have to add a line in this file pg_hba.conf which is in the data directory of your PostgreSQL installation on your host.

 

Under

#host    all         all         ::1/128               md5       Add the following

host      <your dbname> <your username>           <your ip address>/32     MD5

 

fill in the <..> (remove the <>) with the database user and ipaddress of the person connecting to the remote database.

 

So for example

ron        mydb    rondbuser          123.456.789.101/32        MD5

 

Hope that helps!

 

Ron Teitelbaum

President / Principal Software Engineer

US Medical Record Specialists

[EMAIL PROTECTED]

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of cdrick
Sent: Tuesday, May 09, 2006 1:56 PM
To: A friendly place to get answers to even the most basic questions aboutSqueak.
Subject: Re: [Newbies] Postgress Database connection

 

 


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) ...

_______________________________________________
Beginners mailing list
[email protected]
http://lists.squeakfoundation.org/mailman/listinfo/beginners

Reply via email to