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?

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Feb 16, 2015 at 19:03
4
  • 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 Commented Feb 17, 2015 at 14:39
  • my bad. maybe postgresql.conf stackoverflow.com/questions/187438/want-to-change-pgsql-port Commented Feb 17, 2015 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. Commented Feb 17, 2015 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. Commented Feb 18, 2015 at 11:39

1 Answer 1

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;
answered Apr 8, 2015 at 20:38

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.