[Newbies] Postgress Database connection
smacintyre at mac.com
Tue May 9 17:46:43 UTC 2006
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:
| 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].
I hope this helps. What version of postgres are you running?
On May 9, 2006, at 9:07, cdrick wrote:
> Hi again...
> I'm triing to connect to a remote postgres db without success...
> I've use several framework
> Can anyone tell me wich tool(package) to use preferably with
> postgres ? because I'm a bit lost at the moment :). Also, if you
> see what are the problems in my connections attempts
> Thanks for all
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
Edmonton, Alberta, Canada
More information about the Beginners