0

Is there a straightforward way to insert a GeoDataFrame into an existing schema? I love the geopandas.GeoDataFrame.to_postgis but this creates a new schema. I only need to insert a table into an existing schema.

1 Answer 1

2

geopandas.GeoDataFrame.to_postgis should not be creating a new schema. It will throw an error if the specified schema does not exist.

If you have created the schema, this should work just fine:

gdf.to_postgis('tablename', con, schema='schemaname')
1
  • Goodness. That makes sense. I had it right in front of my eyes. Thank you! Feb 13, 2022 at 21:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.