[postgis-users] PostGIS functions not working on AWS via Lambda function

Alexander Gataric gataric at usa.net
Tue Mar 17 11:16:18 PDT 2020


It says the extension already exists. 

⁣Get BlueMail for Android ​

On Mar 17, 2020, 12:07 PM, at 12:07 PM, Giuseppe Broccolo <g.broccolo.7 at gmail.com> wrote:
>Ok, as I told befire lambda functions should rely on RDS instances.
>Once
>you open a connection
>to the DB through psycopg, enable the Postgis extension with
>
>cur.execute("CREATE EXTENSION postgis")
>
>then try to run your UDF.
>
>Giuseppe.
>
>Il giorno mar 17 mar 2020 alle ore 14:38 Alexander Gataric
><gataric at usa.net>
>ha scritto:
>
>> I get the same error message as if PostGIS isn't installed. Function
>not
>> found error.
>>
>> I'm invoking in lambda via python code like this:
>>
>> import boto3
>> import psycopg3
>>
>> def lambda_handler(event,lambda_context)
>>
>> # login and connection stuff
>>
>> cur.execute("select * from schema.udf_name (parm1,parm2)")
>>
>> The UDF invokes several PostGIS functions such as st_dwithin.
>>
>> Get BlueMail for Android <http://www.bluemail.me/r?b=15824>
>> On Mar 17, 2020, at 9:04 AM, Giuseppe Broccolo
><g.broccolo.7 at gmail.com>
>> wrote:
>>>
>>> Hi Alexander,
>>>
>>> can you add further details (snippet of code, etc.) about this?
>>>
>>> Never tried doing this, but AFAIK AWS lambda runs on preconfigured
>RDS
>>> environments,
>>> maybe it's just enough to include the CREATE EXTENSION.
>>>
>>> Giuseppe.
>>>
>>> Il giorno mar 17 mar 2020 alle ore 12:55 Alexander Gataric <
>>> gataric at usa.net> ha scritto:
>>>
>>>> I'm trying to create a service to invoke Postgres UDFs that utilize
>>>> PostGIS
>>>> functions via an AWS lambda function. The error I get is as if the
>>>> PostGIS
>>>> extension is not installed. Has anyone encountered this before?
>>>>
>>>> Thanks
>>>> Alex
>>>>
>>>> _______________________________________________
>>>> postgis-users mailing list
>>>> postgis-users at lists.osgeo.org
>>>> https://lists.osgeo.org/mailman/listinfo/postgis-users
>>>
>>>  ------------------------------
>>>
>>> postgis-users mailing list
>>> postgis-users at lists.osgeo.org
>>> https://lists.osgeo.org/mailman/listinfo/postgis-users
>>>
>>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/postgis-users
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>postgis-users mailing list
>postgis-users at lists.osgeo.org
>https://lists.osgeo.org/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20200317/4e49f532/attachment.html>


More information about the postgis-users mailing list