Using psycopg2 with Lambda to Update Redshift (Python)

In order for this to work you need to build psycopg2 with statically linked libpq.so library. Check out this repo https://github.com/jkehler/awslambda-psycopg2. It has already build psycopg2 package and instructions how to build it yourself. Back to your questions: What is causing this problem? psycopg2 needs to be build an compiled with statically linked libraries for … Read more

Using sql function generate_series() in redshift

Amazon Redshift seems to be based on PostgreSQL 8.0.2. The timestamp arguments to generate_series() were added in 8.4. Something like this, which sidesteps that problem, might work in Redshift. SELECT current_date + (n || ‘ days’)::interval from generate_series (1, 30) n It works in PostgreSQL 8.3, which is the earliest version I can test. It’s … Read more