Select to view content in your preferred language

999999 Add Spatial Join Doesn't Work on External Database

355
4
Jump to solution
06-06-2025 06:30 PM
Labels (1)
ack_ack_ack_ack
Occasional Contributor

Per the title, spatial joins don't work when using an external database. In this case, PostgreSQL.

One table has points encoded as geometry.  ArcGIS correctly identifies them.
The other table has polygons included in a shapefile.  Polygons render correctly on the map.
Attempt to join the two tables using "intersect" generates the error.

ERROR 999999: Something unexpected caused the tool to fail. Contact Esri Technical Support (http://esriurl.com/support) to Report a Bug, and refer to the error help for potential solutions or workarounds.
Invalid SQL syntax[ERROR: syntax error at or near "%"
LINE 1: select bike_share.public.%bike_stations_data_3_8_52_305_1406...
^::SQLSTATE=42601]
Failed to execute (AddSpatialJoin).

How does one workaround the wildcard symbol where it does not belong?
Is it the case that while one can connect to external databases, the feature is totally broken?  

Tags (4)
0 Kudos
2 Solutions

Accepted Solutions
ack_ack_ack_ack
Occasional Contributor

LOL no.   

This is a local Postgresql instance.  I'm using the postgres user credentials. 

The error message makes it obvious the problem is the developers didn't take the time to parse available columns, then write the SELECT statement using the available columns.
The documentation suggests it would "just work."  It does not.  At all.
https://pro.arcgis.com/en/pro-app/3.3/help/data/databases/database-connections-in-arcgis-pro.htm

View solution in original post

0 Kudos
ack_ack_ack_ack
Occasional Contributor
 

1 + 1 = 3
Null.  Duplicate

View solution in original post

0 Kudos
4 Replies
MarcoBoeringa
MVP Alum

In the error I see reference to PostgreSQL's 'public' user schema.

As of PG15, working with public schema to store user data has been strongly discouraged by the the PostgreSQL developers and community due to security concerns, and default access rights revoked. This may be causing you issues.

I recommend you to create a new user with its own dedicated user schema and not grant it superuser rights but just leave it at its ordinary limited rights.

ack_ack_ack_ack
Occasional Contributor

LOL no.   

This is a local Postgresql instance.  I'm using the postgres user credentials. 

The error message makes it obvious the problem is the developers didn't take the time to parse available columns, then write the SELECT statement using the available columns.
The documentation suggests it would "just work."  It does not.  At all.
https://pro.arcgis.com/en/pro-app/3.3/help/data/databases/database-connections-in-arcgis-pro.htm

0 Kudos
ack_ack_ack_ack
Occasional Contributor
 

1 + 1 = 3
Null.  Duplicate

0 Kudos
ack_ack_ack_ack
Occasional Contributor

3 + 3 = 33

Null. Duplicate

Tags (1)
0 Kudos