Skip to main content

Simple Python bindings for PostgreSQL w/ bind parameters

Project description

This is a set of Python bindings for PostgreSQL derived from the PyGreSQL 3.8.1 source. 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.

Source Distribution

python-pgsql-0.9.3.tar.gz (29.6 kB view details)

Uploaded Source

File details

Details for the file python-pgsql-0.9.3.tar.gz.

File metadata

  • Download URL: python-pgsql-0.9.3.tar.gz
  • Upload date:
  • Size: 29.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for python-pgsql-0.9.3.tar.gz
Algorithm Hash digest
SHA256 c478f8437c077b2621748a2c31e90f6ac1af10573cefd4fe0bd231e48d94dd96
MD5 44c51d2592c208cdf9d41a49f4eb18e1
BLAKE2b-256 814e1547662f9742b2b5d5c1f5a513d8eefc088e98e56c0aed2c9eab1b1c78cc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page