<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Problem with connection to PostgreSQL database in Geodatabase Questions</title>
    <link>https://community.esri.com/t5/geodatabase-questions/problem-with-connection-to-postgresql-database/m-p/766793#M697</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am sorry if this question has been answered before.&amp;nbsp; I searched geonet, and haven't found an answer that has worked for me yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having problems connecting a user to a new SDE database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To create the new database, I&amp;nbsp;ran the&amp;nbsp;create enterprise geodatabase tool in ArcCatalog for a&amp;nbsp;PostgreSQL database (ArcMap 10.7, postgreSQL 10.6).&amp;nbsp; The database was created successfully and I can access it using my login credentials (both as my username and as the sde) in ArcCatalog and pgAdmin 4. The database is hosted on a server and our technology dept has allowed access to the database via the pg_hba.conf file for the user that I am working with.&amp;nbsp; The user can use telnet to check the firewalls are working.&amp;nbsp; The user can also login to the database via pgAdmin and through a Python script.&amp;nbsp; However, when they attempt to add a database connection using ArcCatalog or ArcMap they get the following error: "Unable to get database list.&amp;nbsp; A database connection exception has occurred.&amp;nbsp; Unable to connect to database server to retrieve database list; please verify your server name, user name, password info and try again. Bad login user."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To create the user, I ran the following script in pgAdmin:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE&amp;nbsp;USER user WITH NOLOGIN NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION;&lt;/P&gt;&lt;P&gt;REVOKE CONNECT ON DATABASE mydb FROM user;&lt;BR /&gt;REVOKE ALL ON SCHEMA public FROM user;&lt;BR /&gt;REVOKE ALL ON ALL TABLES IN SCHEMA public FROM user;&lt;BR /&gt;REVOKE ALL ON ALL FUNCTIONS IN SCHEMA public FROM user;&lt;BR /&gt;REVOKE ALL ON ALL SEQUENCES IN SCHEMA public FROM user;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GRANT CONNECT ON DATABASE&amp;nbsp;mydb TO user;&lt;BR /&gt;GRANT USAGE ON SCHEMA public TO user;&lt;BR /&gt;GRANT SELECT ON ALL TABLES IN SCHEMA public TO user;&lt;BR /&gt;ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO user;&lt;BR /&gt;GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public TO user;&lt;BR /&gt;GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO user;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the script, the variable "user" was replaced with the username of the person I am working with.&amp;nbsp; I also replaced the variable "mydb" with my database name. I ran the script for both the sde schema and the public schema. I ran this script logged in as both the superuser and as the sde (which is another superuser as far as I can tell).&amp;nbsp; What am I doing wrong or missing?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Sep 2019 17:14:59 GMT</pubDate>
    <dc:creator>GIS_MJ</dc:creator>
    <dc:date>2019-09-10T17:14:59Z</dc:date>
    <item>
      <title>Problem with connection to PostgreSQL database</title>
      <link>https://community.esri.com/t5/geodatabase-questions/problem-with-connection-to-postgresql-database/m-p/766793#M697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am sorry if this question has been answered before.&amp;nbsp; I searched geonet, and haven't found an answer that has worked for me yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having problems connecting a user to a new SDE database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To create the new database, I&amp;nbsp;ran the&amp;nbsp;create enterprise geodatabase tool in ArcCatalog for a&amp;nbsp;PostgreSQL database (ArcMap 10.7, postgreSQL 10.6).&amp;nbsp; The database was created successfully and I can access it using my login credentials (both as my username and as the sde) in ArcCatalog and pgAdmin 4. The database is hosted on a server and our technology dept has allowed access to the database via the pg_hba.conf file for the user that I am working with.&amp;nbsp; The user can use telnet to check the firewalls are working.&amp;nbsp; The user can also login to the database via pgAdmin and through a Python script.&amp;nbsp; However, when they attempt to add a database connection using ArcCatalog or ArcMap they get the following error: "Unable to get database list.&amp;nbsp; A database connection exception has occurred.&amp;nbsp; Unable to connect to database server to retrieve database list; please verify your server name, user name, password info and try again. Bad login user."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To create the user, I ran the following script in pgAdmin:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE&amp;nbsp;USER user WITH NOLOGIN NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION;&lt;/P&gt;&lt;P&gt;REVOKE CONNECT ON DATABASE mydb FROM user;&lt;BR /&gt;REVOKE ALL ON SCHEMA public FROM user;&lt;BR /&gt;REVOKE ALL ON ALL TABLES IN SCHEMA public FROM user;&lt;BR /&gt;REVOKE ALL ON ALL FUNCTIONS IN SCHEMA public FROM user;&lt;BR /&gt;REVOKE ALL ON ALL SEQUENCES IN SCHEMA public FROM user;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GRANT CONNECT ON DATABASE&amp;nbsp;mydb TO user;&lt;BR /&gt;GRANT USAGE ON SCHEMA public TO user;&lt;BR /&gt;GRANT SELECT ON ALL TABLES IN SCHEMA public TO user;&lt;BR /&gt;ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO user;&lt;BR /&gt;GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public TO user;&lt;BR /&gt;GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO user;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the script, the variable "user" was replaced with the username of the person I am working with.&amp;nbsp; I also replaced the variable "mydb" with my database name. I ran the script for both the sde schema and the public schema. I ran this script logged in as both the superuser and as the sde (which is another superuser as far as I can tell).&amp;nbsp; What am I doing wrong or missing?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2019 17:14:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/problem-with-connection-to-postgresql-database/m-p/766793#M697</guid>
      <dc:creator>GIS_MJ</dc:creator>
      <dc:date>2019-09-10T17:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with connection to PostgreSQL database</title>
      <link>https://community.esri.com/t5/geodatabase-questions/problem-with-connection-to-postgresql-database/m-p/766794#M698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;These new users have needs to access both the SDE and public schemas to view the system repository tables. Often when a user cannot connect through ArcGIS but can through pgAdmin, it is related to permissions on SDE or public.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you try one of the methods here to see if you get a different result?:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://desktop.arcgis.com/en/arcmap/10.3/manage-data/gdbs-in-postgresql/add-users-postgresql.htm" title="https://desktop.arcgis.com/en/arcmap/10.3/manage-data/gdbs-in-postgresql/add-users-postgresql.htm"&gt;Add login roles to PostgreSQL—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2019 17:29:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/problem-with-connection-to-postgresql-database/m-p/766794#M698</guid>
      <dc:creator>ChristianWells</dc:creator>
      <dc:date>2019-09-10T17:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with connection to PostgreSQL database</title>
      <link>https://community.esri.com/t5/geodatabase-questions/problem-with-connection-to-postgresql-database/m-p/766795#M699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for replying. Since i granted connect and usage on both the sde and the public schema, wouldn't that be enough permissions?&amp;nbsp; Also, I have not configured the log files at all.&amp;nbsp; I am not sure which configuration to choose when i run the tool (configure log files in arcgis).&amp;nbsp; Do you have any experience with that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2019 18:05:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/problem-with-connection-to-postgresql-database/m-p/766795#M699</guid>
      <dc:creator>GIS_MJ</dc:creator>
      <dc:date>2019-09-10T18:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with connection to PostgreSQL database</title>
      <link>https://community.esri.com/t5/geodatabase-questions/problem-with-connection-to-postgresql-database/m-p/766796#M700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Usage on SDE and public should be enough, as long as the public user has the requisite table, sequence, and functions specified for st_geometry and SDE table access. By testing one of the methods I sent we can then confirm if something is missing from the explicit object permissions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd also be more than happy to get you in touch with Technical Support so that someone could give you a call to troubleshoot and get this figured out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Log files are configured by default but we've had some changes between the last few releases. Could you share which version are you using?&amp;nbsp;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/manage-data/gdbs-in-postgresql/logfiles-postgresql.htm" title="http://desktop.arcgis.com/en/arcmap/latest/manage-data/gdbs-in-postgresql/logfiles-postgresql.htm"&gt;Log file tables in geodatabases in PostgreSQL—Geodatabases in PostgreSQL | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2019 18:19:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/problem-with-connection-to-postgresql-database/m-p/766796#M700</guid>
      <dc:creator>ChristianWells</dc:creator>
      <dc:date>2019-09-10T18:19:52Z</dc:date>
    </item>
  </channel>
</rss>

