A aws psycopg2 package from psycopg2.
Project description
psycopg2 Python Library for AWS Lambda
This is a custom compiled psycopg2 C library for Python. Due to AWS Lambda
missing the required PostgreSQL libraries in the AMI image, we needed to
compile psycopg2 with the PostgreSQL libpq.so
library statically linked
libpq library instead of the default dynamic link.
Install and setup
pip install aws-psycopg2
Source code : https://github.com/AbhimanyuHK/aws-psycopg2
Instructions on compiling this package from scratch
Here was the process that was used to build this package. You will need to perform these steps if you want to build a newer version of the psycopg2 library.
- Download the PostgreSQL source code and extract into a directory.
- Download the psycopg2 source code and extract into a directory.
- Go into the PostgreSQL source directory and execute the following commands:
./configure --prefix {path_to_postgresql_source} --without-readline --without-zlib
make
make install
- Go into the psycopg2 source directory and edit the
setup.cfg
file with the following:
pg_config={path_to_postgresql_source/bin/pg_config}
static_libpq=1
- Execute
python setup.py build
in the psycopg2 source directory.
After the above steps have been completed you will then have a build directory and the custom compiled psycopg2 library will be contained within it. Copy this directory into your AWS Lambda package and you will now be able to access PostgreSQL from within AWS Lambda using the psycopg2 library.
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
Built Distribution
File details
Details for the file aws-psycopg2-1.3.8.tar.gz
.
File metadata
- Download URL: aws-psycopg2-1.3.8.tar.gz
- Upload date:
- Size: 34.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f847bd1cb57830a6b4e3576d79cc67a528ea65aa77a4c7728f9c64dfbb14f91f |
|
MD5 | 1525f3cc91513fbcdd9e14becbbce485 |
|
BLAKE2b-256 | 7c99e044d6056240fdc08d58d3b682975f321c562440dac8fa941fd74835aab5 |
File details
Details for the file aws_psycopg2-1.3.8-py3-none-any.whl
.
File metadata
- Download URL: aws_psycopg2-1.3.8-py3-none-any.whl
- Upload date:
- Size: 73.8 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | be3e186479c1ef1ff21ecf6f8e8260f96fb9380ceac3bfb084ccbc089bdeaa09 |
|
MD5 | e3ef11ade1e0d2c261258066e3900aa8 |
|
BLAKE2b-256 | 1c41ba9c525bead49252cf96fb8c80161b9f45b6db858ab36aecbd1375144b73 |