Path: csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'broken': 0.04; 'retrieved': 0.05; 'subject:Python': 0.06; 'postgresql': 0.07; 'bindings': 0.09; 'deemed': 0.09; 'postgresql,': 0.09; 'python': 0.11; 'windows': 0.15; 'bind': 0.16; 'finney': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'hmm.': 0.16; 'ought': 0.16; 'pgsql': 0.16; 'sqlite': 0.16; 'subject: \n ': 0.16; 'subject:python': 0.16; 'apps': 0.16; 'wrote:': 0.18; 'module': 0.19; "python's": 0.19; 'server,': 0.19; 'small,': 0.19; 'later': 0.20; 'not,': 0.20; 'issue.': 0.22; 'exists': 0.24; 'earlier': 0.24; 'versions': 0.24; 'compiled': 0.26; 'extension': 0.26; 'header:In-Reply-To:1': 0.27; 'correct': 0.29; '[1]': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; '(which': 0.31; 'code': 0.31; 'too.': 0.31; 'libraries': 0.31; 'subject:Database': 0.31; 'url:se': 0.31; 'probably': 0.32; 'compatible': 0.32; 'quite': 0.32; 'linux': 0.33; 'problem': 0.35; 'subject: (': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'version': 0.36; 'library.': 0.36; 'possible': 0.36; 'should': 0.36; 'server': 0.38; 'ben': 0.38; 'version,': 0.38; 'whatever': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'enough': 0.39; 'release': 0.40; 'even': 0.60; 'easy': 0.60; 'around.': 0.60; 'most': 0.60; 'managers': 0.61; 'entire': 0.61; 'more': 0.64; "it'd": 0.84; 'pike': 0.84; 'subject:via': 0.84; 'tie': 0.84; 'mean.': 0.91; 'tied': 0.93; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=RzvL89PZG/7sF7zcAVkwPMpyEEJ2VLOO053yFY/HOMU=; b=AMmN972P5tBMdRbkXOWRQZ2cYS6ilT4hdbS8tO7oCDqbeqBCTL2MWpvDDzfA2bcNqn F62aPyHgGMH2SHFIj2FZjLOmd5md1UovTiHOOugLasJ8tJB2gVrfyqKmscTQXfR5bOT1 y6h0qyRHliQuQ0TbY08Hv4+dsmbQgkw/qI/6sSfJls0alCQVL6e67PRg10C8H514w57N EHU0SOxJ3AdJ9+oLxnuuRvRzl8kSLc7B7o07oEsp1YLRZuqgOzVI5vFwojhEUehWIheH fFQZD/qi/CE0sCiXXw/KdO5+A9mweflduAIIK8L+xXlQfvtC4pgW08k254TnPhNS3gX0 olrQ== MIME-Version: 1.0 X-Received: by 10.68.13.104 with SMTP id g8mr22950986pbc.33.1381022353297; Sat, 05 Oct 2013 18:19:13 -0700 (PDT) In-Reply-To: <7wpprjp5sw.fsf_-_@benfinney.id.au> References: <5250872B.4070803@nedbatchelder.com> <7wpprjp5sw.fsf_-_@benfinney.id.au> Date: Sun, 6 Oct 2013 12:19:13 +1100 Subject: Re: Database engine bindings for Python (was: Database statements via python but database left intact) From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 34 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1381022362 news.xs4all.nl 16012 [2001:888:2000:d::a6]:58110 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:56229 On Sun, Oct 6, 2013 at 12:05 PM, Ben Finney wrote: > The Python bindings for MySQL or PostgreSQL, or even SQLite, are tied to > extension libraries for the specific database engine. > > With SQLite this is not a problem for Python's release management, > because Python's release includes the entire SQLite database engine. > That code is quite small, so this is deemed a good trade. > > With a separately-installed, far more complex database engine like MySQL > or PostgreSQL, the Python bindings will only work if they are compiled > against the correct client library. Hmm. I see what you mean. Of course, that doesn't bind Python to a specific server version, as one version of the client can talk to any earlier and many later versions of server, but it is an issue. It'd probably be unreasonable to package libpq with Windows installations, but with Linux builds, it should be easy enough to link against whatever libpq happens to be around. If that's unsuited to your server version, it's going to be broken for any other libpq-based apps too. (With package managers like apt, same thing - link against whatever version can be retrieved easily.) The alternative is a pure-Python implementation of the PostgreSQL wire protocol. That would most likely be smaller (if the problem is the size cost of incorporating all of libpq), but would tie Python's pgsql module to a specific protocol version (which doesn't change very often). I don't know if one exists already or not, but it ought to be possible to port the Pike module [1] to Python, if GPL/LGPL/MPL is compatible with the Python licensing. ChrisA [1] http://pike.lysator.liu.se/generated/manual/modref/ex/predef_3A_3A/Sql/pgsql.html