Connecting to PostgreSQL databases from Python provides the ability to run essential SQL queries that can be utilized in geoprocessing tasks.
connection = psycopg2.connect(host='prod', database='sde', user='sde', password='sde')
cursor = connection.cursor()
cursor.execute('select * from PARCELS WHERE OBJECTID < 70000')
for query in cursor:
Get help from ArcGIS experts
Download the Esri Support App