1

I have a PostgreSQL database on a computer, hosted on port 5433. on the same computer I also have a database hosted on port 5432

I am trying to connect to the database via ArcMap database connection. typically this is pretty straighforward (if the pg_hba.conf is setup to allow connections)

simply enter the computer name in instance and put in the sign in and password credentials.

I do not know how to connect to the database on port 5433 from another computer

enter image description here

  • how does the database connection know 'arcserver'? – Mapperz Aug 23 '17 at 18:11
  • not sure exactly what you mean, but if i leave out the port part I can connect to all the databases on the default port of 5432 – ziggy Aug 23 '17 at 18:16
  • what happens when you replace 'arcserver' with the IP:5433 (IP address of your database server) – Mapperz Aug 23 '17 at 18:18
  • problem with that is we have ipv4 subnet lease domains where they change eevery few weeks, basically not static ips for workplace – ziggy Aug 23 '17 at 18:29
  • Please try with PostgreSQL Instance name like database name;PGPORT=5433 then it will work. – Pradeep Kanth Jun 6 '18 at 5:39
2

The Esri documentation now specifies this exact case, with an inset box that states:

Note: If your PostgreSQL database cluster is listening on a port other than the default (5432), include the port number in the instance. For example, if PostgreSQL is installed on server mamabear and is listening on port 49200, type mamabear,49200 in the Instance text box.

In general, PostgreSQL is the easiest database for ArcGIS client connection, because the DataStore utilizes PostgreSQL, so the client libraries are included* within the ArcGIS installation. The only real trick is properly configuring the PG server to listen from the network from which you are connecting (which could involve both PostgreSQL.conf and pg_hba.conf within the server instance, as well as the firewall configurations on both server and client).

If you can't get Desktop to connect, you should:

  1. Check the System Requirements from the Esri documentation, to make sure it's supported combination

  2. Install a 32-bit PostgreSQL client and play with firewall and/or server port properties until you can successfully connect via psql

At this point, a new ArcGIS Desktop or standalone ArcPy session should connect with ease.

WARNING: Please note that you shouldn't EVER connect from ArcGIS to PostgreSQL as the postgres user. There is no reason to do this and every reason not to. Check out any book on PostgreSQL (or any database, really) and they will always tell you to create logins for your project. Using the administrative login for just about any task except creating new logins is a disaster waiting to happen!.

*Caveat: The 10.4.1 installation of 64-bit Background Geoprocessing had a bug that left out a required libintl-8.dll file from the bin64 folder. This Geonet blog post has details on the problem. You can contact Tech Support for the QFE (the problem is fixed at 10.5.x).

0

what I had to do is

1.edit the pg_hba.conf add a row (may not be necessary)

host all all 0.0.0.0/0 trust

2.

when connecting to arc using the add database connection. in the instance box I typed "computer name,port" so in my case arcserver,5433

  • Only the comma was necessary from an ArcGIS standpoint. – Vince Aug 23 '17 at 19:11
  • yes Vince, but since someone might encounter the problem like I did I figured it would be nice to give all info – ziggy Aug 23 '17 at 19:16
  • Yet the second bullet doesn't answer the focused questtion. And there are times when the second bullet is incorrect. – Vince Aug 23 '17 at 20:57
  • How doesn't the second bullet point answer the focused question? And when wouldnt that work for my instance? – ziggy Aug 23 '17 at 21:12
  • 1
    Doh. Had it flipped. The first bullet is not needed, or always true. PostgreSQL security is a huge topic. You're recommending leaving the doors unlocked. – Vince Aug 23 '17 at 21:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.