5

I recently setup an ArcSDE database in Postgres, and all seemed good. I am able to connect to it from both ArcMap and ArcCatalog, and work with the data as expected. Thus, I know I got the 32-bit Postgres drivers in the correct location and they are working.

However, I've been trying to get a python script running that needs to write to the SDE database. I have been executing the script using the 32-bit python installed with ArcGIS. I made a database connection in a folder available to the script, which I am using to connect to the database. When I run arcpy.Exists on that connection, it returns True, which is good. Except I cannot read or write any data in the database. (Side question: does this mean arcpy.Exists() on a database connection file only checks to see if the connection file exits, and not if the connection is valid/available?)

I setup a simple little test script:

import arcpy
import os

sde = r"C:\GIS\_SDEConnections\Edituser.sde"

print arcpy.Exists(sde)
print arcpy.Exists(os.path.join(sde, "AWDB"))  # this exists

arcpy.env.workspace = sde

print arcpy.ListFeatureClasses()  # there is one FC in the db
print arcpy.ListDatasets()  # there are two datasets in the db

And I get:

True
False
[]
[]

However, if I try to execute the script with the 64-bit python installed by the Background Geoprocessor, I can see the data in the database. That is, the test script returns:

True
True
[u'sde.sde.dd']
[u'sde.sde.AWDB', u'sde.sde.TestFeatures']

So at this point I figured that the problem lies with the 32-bit python. But here's the kicker: if I try to do these same operations in the python command line in ArcCatalog, I do not have any problems. And ArcCatalog is using the 32-bit python, the same python I tried to use initially.

So, does anyone have any ideas as to what could be the problem? I need to stick with the 32-bit python because of some dependencies. Simply using the 64-bit version is not currently an option.

I am using ArcGIS 10.2.2 and PostgreSQL 9.0.8 (I don't administer the server, so this is the Postgres version I'm stuck with for the moment).

closed as off-topic by PolyGeo Sep 17 '16 at 23:34

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This problem cannot or can no longer be reproduced. Changes to the system or to the asker's circumstances may have rendered the question obsolete, or the question does not include a procedure to enable potential answerers to reproduce the same symptoms. Such questions are off-topic as they are unlikely to help future readers, but editing them to include more details can lead to re-opening." – PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    What version of ArcGIS are you using? What version of PostgreSQL? (please update the question) It seems unlikely that these are modern (10.1 and later ArcGIS, 9.0 and later PG), since only 64-bit binaries are possible with modern ST_GEOMETRY, and registration should fail with a 32-bit server. – Vince Nov 6 '14 at 22:42
  • 1
    32-bit PostgreSQL databases are not supported with ArcGIS 10.2 resources.arcgis.com/en/help/system-requirements/10.2/… I'm amazed you got as far as you did, but the failure to load the ST_GEOMETRY DLL will prevent getting any further – Vince Nov 7 '14 at 1:25
  • 1
    The PostgreSQL is 64-bit. And like I've said, I've setup the database and I can interact with the database without problems except when using the 32-bit python run from the command prompt. – phoetrymaster Nov 7 '14 at 18:11
  • It may seem harsh to close this as non-reproducible but in nearly two years no one has offered an answer nor said that they can reproduce what you are seeing. – PolyGeo Sep 17 '16 at 23:35