<?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 Re: No database name field for PostgreSQL connection in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/no-database-name-field-for-postgresql-connection/m-p/39719#M710</link>
    <description>&lt;P&gt;This is the error.&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;[CANNOT_ESTABLISH_CONNECTION] Cannot establish connection to remote POSTGRESQL database. Please check connection information and credentials e.g. host, port, user and password options. ** If you believe the information is correct, please check your workspace's network setup and ensure it does not have outbound restrictions to the host. Please also check that the host does not block inbound connections from the network where the workspace's Spark clusters are deployed. ** Detailed error message: FATAL: permission denied for database "postgres" Detail: User does not have CONNECT privilege..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am able to connect in a notebook with the following code. The main difference appears to be that I am supplying the database name, but there is no option for that in the Data Explorer in the Workspace UI.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;jdbcURL = f"jdbc:postgresql://{database_creds['host']}/{database_creds['database']}"
Class.forName("org.postgresql.Driver")
df = spark.read.jdbc(url=jdbcURL, table='public.users', properties={'user': USER, 'password': PASSWORD})&lt;/LI-CODE&gt;</description>
    <pubDate>Sat, 12 Aug 2023 13:56:01 GMT</pubDate>
    <dc:creator>jlmontie</dc:creator>
    <dc:date>2023-08-12T13:56:01Z</dc:date>
    <item>
      <title>No database name field for PostgreSQL connection</title>
      <link>https://community.databricks.com/t5/get-started-discussions/no-database-name-field-for-postgresql-connection/m-p/39490#M699</link>
      <description>&lt;P&gt;I'm trying to get my workspace setup by connecting to my PostgreSQL database. I am following &lt;A href="https://docs.databricks.com/en/query-federation/postgresql.html" target="_self"&gt;this article&lt;/A&gt;. The instructions under "Create a connection" are failing because my connection requires a database name. However, the database name is not a supported variable. What options do I have to connect to my database?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2023 05:06:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/no-database-name-field-for-postgresql-connection/m-p/39490#M699</guid>
      <dc:creator>jlmontie</dc:creator>
      <dc:date>2023-08-10T05:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: No database name field for PostgreSQL connection</title>
      <link>https://community.databricks.com/t5/get-started-discussions/no-database-name-field-for-postgresql-connection/m-p/39719#M710</link>
      <description>&lt;P&gt;This is the error.&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;[CANNOT_ESTABLISH_CONNECTION] Cannot establish connection to remote POSTGRESQL database. Please check connection information and credentials e.g. host, port, user and password options. ** If you believe the information is correct, please check your workspace's network setup and ensure it does not have outbound restrictions to the host. Please also check that the host does not block inbound connections from the network where the workspace's Spark clusters are deployed. ** Detailed error message: FATAL: permission denied for database "postgres" Detail: User does not have CONNECT privilege..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am able to connect in a notebook with the following code. The main difference appears to be that I am supplying the database name, but there is no option for that in the Data Explorer in the Workspace UI.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;jdbcURL = f"jdbc:postgresql://{database_creds['host']}/{database_creds['database']}"
Class.forName("org.postgresql.Driver")
df = spark.read.jdbc(url=jdbcURL, table='public.users', properties={'user': USER, 'password': PASSWORD})&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 12 Aug 2023 13:56:01 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/no-database-name-field-for-postgresql-connection/m-p/39719#M710</guid>
      <dc:creator>jlmontie</dc:creator>
      <dc:date>2023-08-12T13:56:01Z</dc:date>
    </item>
  </channel>
</rss>

