This document describes how to get Squeak to work with a PostgreSQL

Setting up the Database


The CAT already has an PostgreSQL database, so we'll use that. 

Setting up ODBC


Since neither of the Squeak PostgreSQL drivers seem to work, we'll use ODBC instead.  Download the ODBC Driver and add it as a data source.

Setting up Squeak


Squeak has an ODBC driver on Squeak Map - install it.  To make sure everything worked, add a test case:

setUp

client := ODBCConnection dsn: 'PostgreSQL' user: 'emerson' password: 'xxx'.
client open.

tearDown

client close


testIsConnected

self assert: client isConnected


testMakeTable

| statement |

statement := ODBCStatement connection: client query:
'create table test (a char(20), b real); '.

statement execute.

statement := ODBCStatement connection: client query:
'drop table test'.

statement execute.