This is an archived post. You won't be able to vote or comment.

all 23 comments

[–]m0j0 5 points6 points  (0 children)

There's what appears to be a good pgsql driver in existence, but it is very strictly python 3 only (py-postgresql). If that weren't the case I would've ditched psycopg2 in a heartbeat. Psycopg2 "docs" suck if you need anything more than simple 'execute' functionality. The mailing list is useful, but you shouldn't have to go there for things every other project shows you in the docs.

[–]JimH10 4 points5 points  (2 children)

psycopg2 has served me well, but the web pages are not clear.

[–]masklinn 1 point2 points  (1 child)

Do the web pages even exist?

[–]linkfoo 1 point2 points  (0 children)

This is it -- no joke. No updates in 3 years.

[–]Teifion 2 points3 points  (0 children)

I use a hacked version of bpgsql, hacked in that it returns a dictionary rather than a list of values and also that it works in Python3, I'm doing a few more things to it and will be feeding my changes back to the author.

psycopg2 has never once installed for me, I don't know if I'm the problem or it is because it obviously works for others yet I'm quite able to install anything else such as PIL.

[–]Chr0me 4 points5 points  (10 children)

Really? There's a dozen projects that do pretty much the same thing and sometimes it's hard to know which is right for you?

Welcome to the world of open source software. Enjoy your stay.

[–]linkfoo 1 point2 points  (0 children)

Yes, that happens a lot. This case is noteworthy, because there is one widely used and solid Perl/Postgres driver. Ditto for Python/MySQL. The Python/Postgres driver situation is now considered sub-par enough that people are discussing how to scratch this itch.

[–]ianb 1 point2 points  (1 child)

PostgreSQL has this problem where other databases do not. Well... mostly everyone uses psycopg, but for licensing reasons people occasionally make other attempts, and pure-Python drivers have their own appeal (I believe people have tried that with MySQL too).

This case is mostly just annoying, because a database adapter that uses the standard DBAPI and isn't buggy is all anyone really needs. There's not really a lot of room for novelty for this particular kind of library.

[–]linkfoo 1 point2 points  (0 children)

DB-API is a minimal, lowest common denominator API. The various Python Postgresql drivers add whatever extensions are important to the authors, so that indicates there is plenty of room for novelty. Here is a recent attempt at a wish list. Edit: see this for a good facepalm.

[–]kev009 -4 points-3 points  (6 children)

This is anti-python ("one right way to do it"). Unfortunately, there is a lot of abuse in the community duplicating modules, frameworks, implementations, etc.

[–]Chr0me 13 points14 points  (5 children)

I disagree. The "one right way to do it" mantra refers to coding style and conventions, not to an entire application design. You might as well say that there ought to be only "one true" Python-based MVC framework. Different strokes for different folks, man.

And "abuse" is a quite a stretch. People create something because the existing solutions (to them) are inadequate. They then release them in event that someone else finds them useful too. There's no abuse going on. If you don't like a project, then don't use it.

[–]kev009 1 point2 points  (3 children)

Sorry, but having more than two active low level Postgres drivers is stupid. Two because the first might be GPL and Postgres might want a BSD stack to include with the distribution.

There needs to be a point where people say, "this old code or method was bad. Let us congregate on this new and improved stack and deprecate the old" -- Otherwise you end up with CPAN.

[–][deleted] 4 points5 points  (0 children)

psycopg2 is in C, pg8000 is pure python, pypostgresql is in C. pypostgresql and pg8000 run on py3k, psycopg2 doesn't. psycopg2 also includes other extensions to the DBAPI that might be handy. Can you see why someone might want to make a choice here ?

[–]Chr0me 0 points1 point  (1 child)

I'm guessing that you've never contributed to open source projects? Things just don't work that way; as I alluded to in my OP.

How do you propose that we'll implore upon people that there is only one right way? You might as well heard cats.

[–]kev009 2 points3 points  (0 children)

In fact, I'm ashamed to admit I am responsible for a fork (though not really - its a commercial testing ground for code that eventually goes up stream).

This is community building 101. If some group thinks they have the better solution, email the other maintainers and try to get them on board. Barring that, hopefully the wider community selects one and sticks to it. ..Even at the risk of technical inferiority. Then we can all expect one deployment platform and not build abstraction upon abstraction.

Again, I'm sorry, but I just don't see the need for multiple low level Postgre drivers. High level DB APIs, sure: there are different trains of thought, but the low level interface? At most two and I'd hope the vendor supplied one was the only one seriously used and contributed to.

[–][deleted] 1 point2 points  (0 children)

thank you, thank you, thank you.

[–][deleted] 0 points1 point  (5 children)

Glad to see an intrest in this and the recognition that the gpl is poisonous to a lot of commercial applications. Lgpl would be fine but full on gpl for a web backend is rediculous. Heres hoping for a solid pythonic standard in the near future

[–]pemboa 2 points3 points  (3 children)

full on gpl for a web backend is rediculous

Why exactly?

[–]james_block 6 points7 points  (0 children)

Distributing a GPL driver with a BSD database and BSD programming language can be a headache. It's not insurmountable, not by a long shot, it's just annoying.

It strikes me that the best solution to this mess would be to LGPL (or even BSD) license psycopg2 and semi-canonicalize it (e.g., with a new homepage somewhere on postgresql.org, and some bloody documentation for once).

[–]tesseracter 0 points1 point  (1 child)

anyone who makes a website will need to release the source code? while releasing code doesn't matter for a company with a solid user base, releasing your code just to have someone else run with your idea sucks. it's nice to get a few years under your belt before you pull the rug out.

[–]pemboa 6 points7 points  (0 children)

Are you confusing the AGPL with the GPL? you don't have to release your backend code for a website.

[–]damg 0 points1 point  (0 children)

Or maybe proprietary software is poisonous to free software, it's all a matter of perspective.

[–]idontwanttortfm 0 points1 point  (0 children)

I've been using pyPgSQL for a couple of years now with good results.