You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This has been an awesome package and has solved so many issues for me until now.
Currently I am using an AWS lambda which needs psycopg2 as a required package to connect to a timescaledb in the cloud.
I always encounter this error and my code can not work:
[ERROR] 2022-11-03T09:38:04.637Z d57f065c-6ac4-4c95-8c2e-7e6c6efd89e8 Error during turning states table into hypertable: function create_hypertable(unknown, unknown, if_not_exists => boolean, chunk_time_interval => interval) does not exist
LINE 1: SELECT create_hypertable('states', 'last_updated', if_not_ex...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
[ERROR] 2022-11-03T09:38:04.640Z d57f065c-6ac4-4c95-8c2e-7e6c6efd89e8 Error during set retention date to hypertable: function add_retention_policy(unknown, if_not_exists => boolean, drop_after => interval) does not exist
LINE 1: SELECT add_retention_policy('states', if_not_exists => TRUE,...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
I tried the same code when running locally in a terminal and it works without any problem, can create the hypertable and the retention policy in my timescale db in cloud.
I also tried pip3 install psycopg2-binary -t ~/some_local_folder and paste all installed folders to my lambda function directory and deploy to AWS Lambda together, but that didn't work either and gave the same error.
I wonder is this create_hypertable and add_retention_policy SQL something specifically not supported by AWS lambda platform? I couldn't find any related reports online. It will be really appreciated if you can shine some lights on this.
Thank you very much!
The text was updated successfully, but these errors were encountered:
I wasn't able to resolve the issues I was having with this, but I was able to set up psycopg2 using klayers.
Klayers is a compilation of python packages built for lambda. They're given as ARNs - to add them, you can scroll to the bottom of your Lambda function in the Lambda console to Layers, click 'Add Layer' in the top-right, select 'Specify an ARN', then paste the ARN for the package you want.
Or you can get a simple list by pasting the API link in your browser: https://api.klayers.cloud//api/v2/{YOUR PYTHON VERSION}/layers/latest/{YOUR AWS REGION}/html
Enter the version of python in the form p0.0 (e.g. p3.8) and the region in the aws shortform (e.g. eu-west-1).
Hello!
This has been an awesome package and has solved so many issues for me until now.
Currently I am using an AWS lambda which needs
psycopg2
as a required package to connect to a timescaledb in the cloud.I always encounter this error and my code can not work:
My code is as below:
I tried the same code when running locally in a terminal and it works without any problem, can create the hypertable and the retention policy in my timescale db in cloud.
I also tried
pip3 install psycopg2-binary -t ~/some_local_folder
and paste all installed folders to my lambda function directory and deploy to AWS Lambda together, but that didn't work either and gave the same error.I wonder is this
create_hypertable
andadd_retention_policy
SQL something specifically not supported by AWS lambda platform? I couldn't find any related reports online. It will be really appreciated if you can shine some lights on this.Thank you very much!
The text was updated successfully, but these errors were encountered: