Skip to main content

PostgreSQL bindings for Python w/ bind parameters support

Project description

This is a set of Python bindings for PostgreSQL derived from the PyGreSQL 3.8.1
sources. The main changes from the PyGreSQL module are:

* support for bind parameters, alleviating the need for extensive, expensive and
vulnerable quoting of user-supplied data
* support for server side cursors for looping through large query results
without loading up the entire result set in the client's memory
* returned values are translated to Python objects in the C layer, resulting in
some speed improvement
* DB API 2.0 compliance, with some extensions

PostgreSQL allows for numeric parameters to be passed in a query (bind
parameters). If parameters are used, they are referred to in the query string as
$1, $2, etc. Bind parameters are passed in as a tuple that holds the values
bound in the query. The primary advantage of using bind parameters is that
parameter values may be separated from the command string, thus avoiding the
need for tedious and error-prone quoting and escaping.

Because of the different query syntax between what PostgreSQL natively supports
and what PyGreSQL used to implement (Python style substitutions like %s and
%(name)s), these bindings will not grok SQL queries written for PyGreSQL - you
might need to slightly rework some of your queries to take advantage of the bind
parameter support.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for python-pgsql, version 0.9.5
Filename, size File type Python version Upload date Hashes
Filename, size python-pgsql-0.9.5.tar.gz (33.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page