473,486 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

your opinion about psycopg vs pygresql

Hi all,

I'm playing a bit with PostgreSQL, in which I've set me the target to
create a python script which with user input creates a new user role and
a database with that owner (connecting to template1 since I know that at
least that db exists).

Ok so I installed PostGreSQL and pygresql since it looked like that this
is endorsed by PG, I had some trouble with the DB-API2 (complains about
there is already a connection to template1, even when I closed and
deleted the connector) so I solved it by using the pg api.

But I was intrigued by this problem and started googling and by that
time I've noticed that python projects like Django seem to favor the
psycopg module.

So I installed that one (the 1.1 version, since Django uses that too)
and it looked like it has the same problem of creating a user after a
database, I'm sure that there is a user error in there somewhere :-)

However, given the choice, what in your opinion would be the reason why
someone would chose one over the other? Now I know this could easily get
into a flamewar, so if you comment (but please do so) I'll still
investigate that, since at this moment I don't even have a clue how they
differ and on what reason, why does PostgreSQL seem to favour pygresql
and Pythoneers psycopg?

Thanks in advance.

--
mph
Dec 20 '06 #1
2 4348
Martin P. Hellwig wrote:
Hi all,

I'm playing a bit with PostgreSQL, in which I've set me the target to
create a python script which with user input creates a new user role and
a database with that owner (connecting to template1 since I know that at
least that db exists).

Ok so I installed PostGreSQL and pygresql since it looked like that this
is endorsed by PG, I had some trouble with the DB-API2 (complains about
there is already a connection to template1, even when I closed and
deleted the connector) so I solved it by using the pg api.

But I was intrigued by this problem and started googling and by that
time I've noticed that python projects like Django seem to favor the
psycopg module.

So I installed that one (the 1.1 version, since Django uses that too)
and it looked like it has the same problem of creating a user after a
database, I'm sure that there is a user error in there somewhere :-)

However, given the choice, what in your opinion would be the reason why
someone would chose one over the other? Now I know this could easily get
into a flamewar, so if you comment (but please do so) I'll still
investigate that, since at this moment I don't even have a clue how they
differ and on what reason, why does PostgreSQL seem to favour pygresql
and Pythoneers psycopg?

Thanks in advance.
I have not used pygresql but I see it often as a standard package with the
SUSE DISTRO. But I use Psycopg 2. I find that it is very fast and provides
a few extentions that I have used. Reported bugs are fixed immediately.

John
Dec 21 '06 #2
Martin P. Hellwig wrote:
However, given the choice, what in your opinion would be the reason why
someone would chose one over the other? Now I know this could easily get
into a flamewar, so if you comment (but please do so) I'll still
investigate that, since at this moment I don't even have a clue how they
differ and on what reason, why does PostgreSQL seem to favour pygresql
and Pythoneers psycopg?

Thanks in advance.
Well, my info can be a little out of date, since I researched this
problem more than a year ago.
AFAIK, psycopg still lacks prepared statements, which can be a huge
drawback (partial workaround: use executemany() whenever possible).
Psycopg 2 (as opposed to psycopg 1.1) does not support commit() on
cursor (no serialized connections)

Among the advantages of psycopg 2 is its very good support of mappings
between Python data types and PostgreSQL data types. You can easily
introduce your own mappings, even for composite data types.

My $0.02

Dec 21 '06 #3

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

Similar topics

1
1925
by: Radu Stanciu | last post by:
Hi, I want to use the PygreSQL modules on a Windows machine (more exactly a WinXP one). I've downloaded the latest version (3.4 so far) and I am required to build the pgmodule C library. Is...
4
5798
by: Chuck Amadi | last post by:
Hi all Anyone know a good Pygresql Tutorial for Interfacing between Python & Postgresql . Cheers Chuck
2
2760
by: Neil Zanella | last post by:
Hello, I am using the following with python: The PyQt python bindings: http://www.riverbankcomputing.co.uk/pyqt/ based on the Qt GUI Application Framework:
11
8942
by: Alban Hertroys | last post by:
Oh no! It's me and transactions again :) I'm not really sure whether this is a limitation of psycopg or postgresql. When I use multiple cursors in a transaction, the records inserted at the...
7
7975
by: jslowery | last post by:
Hello, I'm new to both PostgreSQL and psycopg and I'm trying to connect to my database running on localhost. I have postgres setup to do md5 authentication and this works when using a db admin tool...
4
3212
by: Michele Simionato | last post by:
Look at this example: >>> import psycopg >>> psycopg.__version__ '1.1.19' >>> import datetime >>> today = datetime.datetime.today() >>> co = psycopg.connect('') >>> cu = co.cursor()
1
2515
by: Jan Danielsson | last post by:
Hello all, I'm trying to use pygresql to insert binary data (type: bytea) into a column (using postgresql, obviously). To make a long story short: I can't get it to work. Not even by cutting...
2
2578
by: goodepic | last post by:
I successfully installed postgresql and pygresql from source on my MacBook 2ghz Intel core duo running os x 10.4.8. However, pygresql installed under the defualt python 2.3 installation, while...
0
853
by: D'Arcy J.M. Cain | last post by:
On Mon, 19 May 2008 18:00:30 +0200 <ervin.ramonllari@hotmail.comwrote: I assume that you got the installer from http://www.PyGreSQL.org/. If so, please join the PyGreSQL list (see above URL)...
0
7099
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,...
0
6964
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6842
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
7319
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
5430
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,...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
262
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.