I'm trying to connect my local PostgreSQL database to ArcMap 10.1 but for some reason I'm unable to connect to the server. Any ideas of what might be causing the issue. For the instance option in ArcMap I'm using the name of my server which is PostgreSQL 9.3 but i get "the unable to connect to data server" error. I have also tried localhost:5432 but i get the same error. Attached there is a pic showing the error the inputs and PostgreSQL server properties. Thanks for the help
-
Is Postgresql installed on your local computer, or on a server? Please give more details about your configuration.– Get SpatialCommented Dec 5, 2013 at 23:22
-
Take a look at the answer in Postgresql for Qgis and Arcgis - What to do/What not to do as well as What does 'DBMS table not found' message mean? and see if any of the guidelines there will resolve your issue. If so, please post your findings.– RyanKDaltonCommented Dec 5, 2013 at 23:54
-
Ok sounds good, thank you. ill post the answer if i can find it– Daniel_JimenezCommented Dec 5, 2013 at 23:56
-
ArcGIS desktop is 32 bit so make sure you are using the correct 32 bit client. Also, please specify if your db is local or on a remote machine. That is an important detail.– Rich WawrzonekCommented Dec 6, 2013 at 0:09
-
The server is on a local connection, I'm running windows 7 64 bit and PostgreSQL 9.3– Daniel_JimenezCommented Dec 6, 2013 at 16:13
3 Answers
Have you looked at Setting up a connection to PostgreSQL, specifically step #5 (you said you already have the client files):
Alter the PostgreSQL pg_hba.conf file on the database server to accept client connections. See the PostgreSQL documentation for information on altering the pg_hba.conf file.
I have an instance of PostgreSQL 9.3 that works with ArcGIS 10.2, but step 5 is a must. Even with the client files, ArcGIS still connects via tcp/ip (which is disabled by default).
-
This worked finally. I followed the instructions and added an extra line that under the 'host all all 127.0.0.1/32 md5' 'host all all personal ip address md5' I also had to put the .dll files in the arcgis folder and grant permission to user. Thanks all for the help Commented Dec 6, 2013 at 21:47
-
This worked for me today. My client machine had a different public IP--went to icanhazip.com and added that IP to the pg_hba.conf. One additional tip--for ArcMap 10.2.1, once I got the error I couldn't refresh my connection and kept the receiving
the unable to connect to data server
error. I had to completely exit ArcMap and restart in order for the connection to be successful. ArcMap must be caching something--PGAdmin had no problems connecting after I updated pg_hba.conf. Commented Oct 22, 2014 at 14:10 -
1It looks like the DBMS client files have moved -- anyone know where they might be found? Commented Jun 1, 2015 at 20:05
-
@user13706 I think they've always been available through My ESRI, where you can download patches and other additional files. They may also be on the original installation media as well. Technically, there's nothing special about the files that ESRI distributes, you should be able to use the client files that come with an installation of PostgreSQL itself too. Commented Jun 3, 2015 at 10:58
The "instance" is the hostname not the pgAdmin-III descriptor. A comma is used to separate the port (only necessary if it's not the default of 5432).
-
I tried localhost as well, but i keep getting the same error Commented Dec 5, 2013 at 23:18
-
2PostgreSQL 9.3 isn't supported with any release of ArcGIS yet (10.1 only supports PG 9.0 & PG 9.1), but if it's just a Query Layer you're after, there's still a possibility that it will work.– VinceCommented Dec 5, 2013 at 23:29
-
You are right, I'm just trying to create a query layer, but that might be the reason why i cant connect to the database Commented Dec 5, 2013 at 23:33
Have you installed the client files for PostgreSQL in the ArcGIS /bin/ folder?
I had a very similar problem that I fixed by copying libeay32.dll, libiconv-2.dll, libintl-8.dll, libpq.dll, and ssleay32.dll from the PostgreSQL folder and put it into the ArcGIS10.1 \Bin\ folder.
Are you running PostgreSQL locally or is the server somewhere else?
Also try using just localhost in the instance box, that's what works for me.
-
Yeah, i think i saw your previous post and i did put those .dll files in the Arcgis bin folder. I'm running it locally. Commented Dec 5, 2013 at 23:24
-
Also try using just localhost in the instance box, that's what works for me.– KevinCommented Dec 5, 2013 at 23:27
-
I tried that, im getting the same error, i don't know what else to do, I'm at a dead end here. Commented Dec 5, 2013 at 23:30
-
@Daniel_Jimenez in Evil Genius's answer it says that ArcGIS connects by TCP/IP default. What happens when you enable PostgreSQL to listen on IPv4 and try connecting to your local machines IP? You'll also have to add an entry into pg_hba.conf to allow connections from your LAN.– SaultDonCommented Dec 6, 2013 at 2:31