[Newbies] Postgress Database connection

Ron Teitelbaum Ron at USMedRec.com
Tue May 9 18:26:14 UTC 2006


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

Ron at USMedRec.com 

 

  _____  

From: beginners-bounces at lists.squeakfoundation.org
[mailto:beginners-bounces at lists.squeakfoundation.org] 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) ...

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20060509/f2a6fc2c/attachment-0001.htm


More information about the Beginners mailing list