1

Currently, I am trying to convert a geodb to a table in my PostgreSQL db with arcpy as such. I've tried both with the parcels table being created and the parcels table not being created

arcpy.TableToTable_conversion("C:/Temp/geodb.gdb\parcels", "C:/../postgresconn.sde", "parcels")

I know my ../postgresconn.sde works because I can do other things such as FeatureClassToFeatureClass_conversion via...

arcpy.FeatureClassToFeatureClass_conversion("C:/../postgresconn.sde\database.public.area", "C:/Temp/geodb.gdb", "area", "", "", "")

The problem is in the TableToTable method, is that I cannot use database.public.area (dots are not allowed in that argument string)

I have set my searchpath on the PostgreSQL sql side to point to database.public hoping that it would just reference that schema.

The error I am getting ...

arcgisscripting.ExecuteError: ERROR 000210: Cannot create output C:\...\postgresconn.sde\area

How can I make the method call TableToTable work in this scenario?

  • ArcGIS is incapable of creating tables with a schema other than that of the login name. Personally, I find public schema use to be a lazy alternative to proper database design, but I have no difficulty using whatever schema I desire if I'm willing to populate an interim table in the login schema, then populate my target table with an INSERT INTO ... SELECT ... statement executed through an arcpy.ArcSDESQLExecute cursor. – Vince Jan 29 at 0:21
  • 1
    Can you further explain the login name? I create a login name that points directly to the schema that I am using? I am only using public right now to get this to work, as this is my first time trying to do stuff with arcpy and a database. Also, thanks for the help! – Garett Roberts Jan 29 at 15:50
  • The documentation covers this. If you want to manage spatial data with ArcGIS, you need to create schemas that correspond to the logins. Using public will only generate problems. – Vince Jan 29 at 22:43

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.