How do I connect to Postgress from Windows version of Python 1.5.2 ??

Christian Tismer tismer at appliedbiometrics.com
Fri Sep 10 11:31:57 EDT 1999


"Eric B." wrote:
> 
> We have Postgress running on a Linux box and I am trying to connect to
> it from my Windows 98 machine using Python 1.5.2 (Windows package).  I
> looked into "PyGress" but that seemed to be set up for a non-Windows
> flavor of Python.  Can anyone help me?
> Thanx!!!

Install the Postgres ODBC driver. It can be found here:
http://www.insightdist.com/download/versions/v06-40-0006/postdrv.exe

Configure the driver to use your Linux installation properly.

Get a copy of mxODBC ( http://starship.python.net/crew/lemburg/ )
and use its indows driver. This worked for us.

>From one of the database classes:

    def opendb(self):
        if self.verbose:
            print "opening database"
            sys.stdout.flush()
        self.db =
odbc.Windows.Connect('PostgreSQL',user='vp',password='')
        
FYI, after a while, we recognized that this is quite slow, due to
Postgres at all and maybe the ODBC interface, so we don't use it
for real applications.

hope this helps - chris

-- 
Christian Tismer             :^)   <mailto:tismer at appliedbiometrics.com>
Applied Biometrics GmbH      :     Have a break! Take a ride on Python's
Kaiserin-Augusta-Allee 101   :    *Starship* http://starship.python.net
10553 Berlin                 :     PGP key -> http://wwwkeys.pgp.net
PGP Fingerprint       E182 71C7 1A9D 66E9 9D15  D3CC D4D7 93E2 1FAE F6DF
     we're tired of banana software - shipped green, ripens at home




More information about the Python-list mailing list