[postgis-users] ssl connection has been closed unexpectedly

Giuseppe Broccolo g.broccolo.7 at gmail.com
Mon Nov 30 08:25:11 PST 2020


Hi David,

Il giorno dom 29 nov 2020 alle ore 01:20 Shaozhong SHI <
shishaozhong at gmail.com> ha scritto:

> Hi,
>
> I keep getting the following error when I use engine =
> create_engine(logging in details to postgres)
> df.to_sql('table_name', and etc.)
>
>
> OperationalError: (psycopg2.OperationalError) SSL connection has been
> closed unexpectedly
>
> (Background on this error at: http://sqlalche.me/e/13/e3q8)
> OperationalError: (psycopg2.OperationalError) SSL connection has been
> closed unexpectedly
>
> Can anyone shed any light on this?
>

This question is not really related to PostGIS, anyway...

Looks like you are trying to persist a Python Pandas dataframe into a
PostgreSQL table using
SQLAlchemy as driver. You are omitting to specify the connection string you
used to create the engine
that needs to be passed into the to_sql() Pandas' method, but the issue is
probably there:
the OperationlError exception is generally raised when SQLAlchemy is not
able to open a proper connection
to the DB.

Giuseppe.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20201130/8ba09350/attachment.html>


More information about the postgis-users mailing list