473,505 Members | 14,136 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Postgresql - Preferred Python Library

Hi All
I have noticed that there are a numbe rof client libraries for connecting to
Postgres.

Can anyone tell me what is the recommended Python library for database
connections

many thanks
Jul 18 '05 #1
6 2257
On 2004-09-10, Matt Goodall <ma**@pollenation.net> wrote:
I've just started experimenting with psycopg2
(http://wiki.initd.org/Projects/PsycopgTwo) and it's looking good.

As far as I know, psycopg2 is the only DB-API 2.0 implementation for
PostgreSQL that uses Python 2.3's datetime types by default.

ooh, aah. :o)

Yes, the datetime handling in the older psycopg was getting on my
nerves... Native datetime is going to make things much nicer.

That said, psycopg works very well for me.

The only other thing that is a bit strange is passing array
types in to the database. I have been using this:

alist = ['foo', 'bar']
query = 'SELECT ARRAY%(alist)s'
execute(query, locals())

It works perfectly well, but it seems a bit strange...

Jul 18 '05 #2
On 2004-09-09, Graeme Matthew <gr************@contrado.com.au> wrote:
Can anyone tell me what is the recommended Python library for database
connections


My preference is psycopg, but I also try to test with the standard one that
comes with postgres (the DBAPI module is pgdb) and pyPgSQL.

Dave Cook

Jul 18 '05 #3
Cliff Wells <cl************@comcast.net> wrote:
On Thu, 2004-09-09 at 16:21, Graeme Matthew wrote:

I have noticed that there are a numbe rof client libraries for connecting to
Postgres.

Can anyone tell me what is the recommended Python library for database
connections


I'd strongly recommend psycopg. I've used both psycopg and the pgsql
module and found psycopg to be much more stable.


So have I, and I wish I could quantify the difference. It's not like
pyPgSQL crashes on me every day, but there's something intangible about
psycopg that appeals to me. I've switched to it everywhere.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Jul 18 '05 #4
On Fri, 2004-09-10 at 23:04 -0700, Tim Roberts wrote:
Cliff Wells <cl************@comcast.net> wrote:
On Thu, 2004-09-09 at 16:21, Graeme Matthew wrote:

I have noticed that there are a numbe rof client libraries for connecting to
Postgres.

Can anyone tell me what is the recommended Python library for database
connections


I'd strongly recommend psycopg. I've used both psycopg and the pgsql
module and found psycopg to be much more stable.


So have I, and I wish I could quantify the difference. It's not like
pyPgSQL crashes on me every day, but there's something intangible about
psycopg that appeals to me. I've switched to it everywhere.


My tangible difference was that a script I have that inserts about
40,000 records into a table (as a single transaction) could never
complete (hard crash) with the standard pgsql module but completes
without a hitch with psycopg. Other than that I don't have a problem
with it <wink>.

Cliff

--
Cliff Wells <cl************@comcast.net>

Jul 18 '05 #5
> I've just started experimenting with psycopg2
(http://wiki.initd.org/Projects/PsycopgTwo) and it's looking good.


Matt,

on my research of Python connectors to postgresql I also saw psycopg. I had
to stop further testing because no win32 binaries were available.

My knowledge grew since then, and meanwhile I was able to compile pyPgSQL
myself using the instructions and MingW32.

I was not able to compile psycopg2 with MingW32. I assume you use it
outside windows, or do you have any binaries for Win32 and psycopg? The
type issue sounds promising, would like to test it ..

Harald
Jul 18 '05 #6
Harald Massa wrote:
I've just started experimenting with psycopg2
(http://wiki.initd.org/Projects/PsycopgTwo) and it's looking good.

Matt,

on my research of Python connectors to postgresql I also saw psycopg. I had
to stop further testing because no win32 binaries were available.


They are!
Look here: http://www.stickpeople.com/projects/...opg/index.html

That link is on their site http://initd.org/software/initd/psycopg ....
--Irmen
Jul 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2151
by: Otis Green | last post by:
Vote for or against a new newsgroup proposal. To summarize what you need to do, just send an empty e-mail to postgresql-ballot@netagw.com You will receive a ballot by e-mail. Follow the...
2
2053
by: Dave Haynes | last post by:
Hi, This is just as much a PostgreSQL question as a Python one, but here goes... I've been trying to port the psycopg interface to a Win2K client (server runs FreeBSD). I'm using MinGW32...
3
1539
by: Steve | last post by:
Hi, Can someone please point me out to some module/library for using PostgreSQL from python? Perhaps a tutorial as wel? Thanks! Steve
59
7100
by: Jeff Bowden | last post by:
For ease of configuration and other reasons, I would like for my single-user GUI app to be able to use postgresql in-process as a library accessing a database created in the users home directory. ...
19
18596
by: Mike Cox | last post by:
Has anyone created something like that for Postgresql? It would be really handy to encrypt credit card numbers and other information so it stays secure. If no one has created anything such as...
1
1334
by: Jerry LeVan | last post by:
Is it possible to build the python postgresql support library on Mac OSX 10.3.5 with the default python install? Adding "--with-python" gets an error message about libpython not being a shared...
4
1678
by: Bill Jackson | last post by:
Is there a preferred random library? scipy.random random Besides scipy's library returning ndarrays, is there any other advantage/disadvantage?
4
1508
by: Ben Sizer | last post by:
I've been looking for a Windows version of a library to interface to PostgreSQL, but can only find ones compiled under Python version 2.4. Is there a 2.5 build out there? -- Ben Sizer
0
1605
by: David Michael Schruth, | last post by:
Hi, I am sort of in a jam here. I am using the PsycoPG2 library to read data out of a windows XP based PostGIS / PostGreSQL database but I am apparently unable to write (update or insert) even...
0
7216
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
7018
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5613
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5028
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1528
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
407
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.