Python + PostgreSQL

L

Lobo

Hi,

I am new to this newsgroup (and new to Python and PostgreSQL). My
experience (17+ years) has been with Smalltalk (e.g. VAST) and Object
databases (e.g. Versant, OmniBase).

I now have a new project to develop web applications using the latest/
best possible versions of Python (3.x?) with PostgreSQL (8.x?, with
pgAdmin 1.10?).

I hope to get some hints as of what frameworks/modules to use for this
specific combination (Python + PostgreSQL)?, should I use django,
zope, web2py, psycopg module, others?, what are their pros/cons?.

Your help is greatly appreciated - thanks !

Carlos
 
K

Krishnakant

hello,

Hi,

I am new to this newsgroup (and new to Python and PostgreSQL). My
experience (17+ years) has been with Smalltalk (e.g. VAST) and Object
databases (e.g. Versant, OmniBase).
Welcome to the world of monty pythons,
/\/\/\:
I now have a new project to develop web applications using the latest/
best possible versions of Python (3.x?) with PostgreSQL (8.x?, with
pgAdmin 1.10?).
It is still a better option to go with python 2.x latest releases IMHO.
I hope to get some hints as of what frameworks/modules to use for this
specific combination (Python + PostgreSQL)?, should I use django,
zope, web2py, psycopg module, others?, what are their pros/cons?.
With regards the web apps, zope is the best server I ever saw in my 10
years of II.T curier.

Python-psycopg2 is the most commonly used DBAPI implementations for
postgresql.

happy hacking.
Krishnakant.
 
M

Marco Mariani

Lobo said:
I now have a new project to develop web applications using the latest/
best possible versions of Python (3.x?) with PostgreSQL (8.x?, with
pgAdmin 1.10?).

You want to use Python 2.5.x (or 2.6 if your framework of choice already
supports it), Postgres 8.3 and have a look at SQLAlchemy (please do).

As for the framework of choice, "it depends" :)
 
P

Philip Semanchuk

Hi,

I am new to this newsgroup (and new to Python and PostgreSQL). My
experience (17+ years) has been with Smalltalk (e.g. VAST) and Object
databases (e.g. Versant, OmniBase).

I now have a new project to develop web applications using the latest/
best possible versions of Python (3.x?) with PostgreSQL (8.x?, with
pgAdmin 1.10?).

I hope to get some hints as of what frameworks/modules to use for this
specific combination (Python + PostgreSQL)?, should I use django,
zope, web2py, psycopg module, others?, what are their pros/cons?.

Hi Carlos,
You'll find a lot of libraries and projects aren't supporting Python
3.x yet. Consider (as others have suggested) working in Python 2.6 to
ease the transition to 3.x when you & your libs are ready.

I've used Psycopg2 to talk to Postgres from Python and had great
success with it.

As far as Django versus Zope versus web2py versus Pylons versus
TurboGears versus... Well, there's enough flamewar material in there
to power New York for centuries. They've all got their strengths and
weaknesses. I know which I prefer but my needs and preferences are my
own and only you know yours.

One thing I will note is that Zope's database is an object hierarchy
which sounds like a familiar tool for you, so that might ease your
transition into the Python world.


Good luck
Philip
 
L

Lobo

Many thanks to all for your valuable input.

I've done some research and I believe I will use (at least for now, to
make it simple) psycopg2 module to connect Python to PostgreSQL.

I am wondering whether I can jump directly to Python 3.x (instead of
using Python 2.6), depending of course on psycopg2 compatibility?.

I saw in a different post that psycopg2 does work on Python 3.x as
long as a patch is applied (by Martin v. Löwis):

http://groups.google.com/group/comp...st&q=python3+postgresql&#doc_29389da8b2b83188

Do you know where can I find this patch, and if it does fully solve
any incompatibility issues to be able to use Python 3.x without
problems?.

Or should I just use Python 2.6?.

What would you recommend?.

Many thanks again,

Carlos
 
P

Philip Semanchuk

Many thanks to all for your valuable input.

I've done some research and I believe I will use (at least for now, to
make it simple) psycopg2 module to connect Python to PostgreSQL.

I am wondering whether I can jump directly to Python 3.x (instead of
using Python 2.6), depending of course on psycopg2 compatibility?.


You can, but as you observed you'll be running a patched version of
psycopg2. If this is the only extension module library you think
you'll need in your project, then running Python 3.x is fine.
Otherwise you might run into surprises when you find that there's a
lot fewer extensions available for 3.x than for 2.x. That's changing,
but it seems to be the state of the Python world today.

Case in point -- you said your project is a Web project, yes? Then
whatever Web framework you use will need to have been ported to 3.x.
At this point, I don't know if any of the major ones have been.


I know that as a new user you'd like to start using the latest &
greatest version of Python so that you don't put your project in a
position where you know you'll have to upgrade at some point in the
future, but that's probably your best course of action at the moment.

Good luck
Philip
 
J

Jeroen Ruigrok van der Werven

-On [20090318 04:01] said:
I am wondering whether I can jump directly to Python 3.x (instead of
using Python 2.6), depending of course on psycopg2 compatibility?.

Might I suggest sticking to 2.6 for now?

The 2.x series is what is now going around as 'stable' in the Python world.
Almost all third-party modules are written for 2.x (typically 2.3 or 2.4 and
higher). 3.0 is very new and the documentation and modules are not just up
to the standard of the 2.x series.

Using 3.0 right now will get you little added benefit at this point in time.

Also, chalk up my preference for SQLAlchemy.
 
M

Martin v. Löwis

I saw in a different post that psycopg2 does work on Python 3.x as
long as a patch is applied (by Martin v. Löwis):
[...]
Do you know where can I find this patch

It's linked in

http://wiki.python.org/moin/Early2to3Migrations

and lives in

http://www.dcl.hpi.uni-potsdam.de/home/loewis/psycopg_3k_v2.diff
(or perhaps a later version should I need to apply more fixes)
and if it does fully solve
any incompatibility issues to be able to use Python 3.x without
problems?.

I think it should resolve all issues for psycopg2. If you find issues,
I would certainly like to know.

Of course, it does not magically resolve *all* problems that you
might have with Python 3.x.

Regards,
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top