2

I have a database connection to a postgresql database on a non-default port, 5433.

I specify TESTDB,5433 as the instance and I can connect with no errors. enter image description here

If I open that connection properties again, the Instance is displayed with no port configured: enter image description here

When I hit cancel and the double-click the connection, I connect successfully to the 5433 port (confirmed by checking the server status of the 5433 and seeing the incoming connection). Even after hitting OK on the Instance without a port...the connection still connects to 5433. Only after expliciting specifying TESTDB,5432 can I switch back to the 5432.

Since both instances have the same data schema (and often the same data), how would an ArcGIS user know which instance he or she is connected to?

  • go to the server configuration file and the port is likely configured in there. It has been a while since I had a postgres installation but I think it is config.conf in the etc folder – Brad Nesom Feb 17 '15 at 14:39
  • my bad. maybe postgresql.conf stackoverflow.com/questions/187438/want-to-change-pgsql-port – Brad Nesom Feb 17 '15 at 14:40
  • The postgresql.conf is server-side and I already know what ports I'm running, both 5432 and 5433 (and 5434 and 5435 but those don't have the same databases on them). How would a user who doesn't have administrative access to the database server, know the connection after it has been created. – Jay Cummins Feb 17 '15 at 17:53
  • @JayCummins, I experience the same issue as you and the only solution that I could find is to create a Python add-in and add a new right-click context menu item for the enterprise database in ArcMap for all users (so they right-click the db, click Show port and then a alert window is shown with the port number). The code behind is just arcpy.Describe() object with method connectionProperties and property instance. – Alex Tereshenkov Feb 18 '15 at 11:39
0

I've mitigated this issue by:

  1. Put the port number in the name of the connection file as soon as its created.

  2. Add a view that will report system info--the view will be visible in ArcCatalog, so you can see which port you are connected on:

enter image description here

enter image description here

CREATE VIEW public.vw_sysinfo AS 
 SELECT inet_server_port() AS inet_server_port, 
    current_database() AS current_database, pg_backend_pid() AS pg_backend_pid, 
    "current_user"() AS "current_user", version() AS version, 
    postgis_version() AS postgis_version;

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.