<?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>idea Support PostgreSQL connection without &amp;quot;public&amp;quot; schema in Data Management Ideas</title>
    <link>https://community.esri.com/t5/data-management-ideas/support-postgresql-connection-without-quot-public/idi-p/935406</link>
    <description>&lt;P&gt;&lt;STRONG&gt;Support PostgreSQL/PostGIS connections without a default "public" schema.&lt;/STRONG&gt;&amp;nbsp; As of 10.4.1, ArcGIS still is not able to connect to a PostgreSQL database if PostGIS is installed in a different schema.&amp;nbsp; In the modern database landscape, this would appear not only as a limitation but as a defect.&amp;nbsp; It is certainly not a valid reason for requiring refactoring or creating one's database to accommodate such a narrow implementation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ArcGIS can and should easily be able to connect to PostgreSQL/PostGIS installations and data in any schema, even if no "public" schema exists at all.&amp;nbsp; It is a default schema on the server but not required; it can be and often is renamed or deleted like any other schema.&amp;nbsp; Some DB admins automatically remove it and the "public" user/role as a basic matter of security &lt;EM&gt;because&lt;/EM&gt; it is a default.&amp;nbsp; Starting with version 2.3.0 (released Sept 26, 2016), PostGIS installation is non-relocatable into the "postgis" schema.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see two immediate, straight &lt;SPAN&gt;forward&lt;/SPAN&gt; implementations (I'm sure there are others):&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Rely on the &lt;SPAN&gt;search_path&lt;/SPAN&gt; variable, as most probably do in their other PostGIS interactions, and do not specify a schema with the PostGIS calls, or&lt;/LI&gt;&lt;LI&gt;Ask the user to specify the schema into which PostGIS is installed.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In any case, all explicit references to or dependencies on the "public" schema should be removed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;REFERENCES&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Example of problem:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/174833" target="_blank" rel="noopener"&gt;Errors when postgis extension (PostgreSQL) is installed in a schema other than "public".&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error message:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Failed to connect to the specified server. Do you want to continue?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Underlying DBMS error[ERROR: schema "public" does not exist&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LINE 1: SELECT public.postgis_lib_version()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;^SQL state: 3F000]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PostGIS non-relocatable:&lt;BR /&gt;&lt;A title="http://postgis.net/2016/09/26/postgis-2.3.0/" href="http://postgis.net/2016/09/26/postgis-2.3.0/" target="_blank" rel="noopener"&gt;PostGIS — PostGIS 2.3.0 Released&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A title="https://trac.osgeo.org/postgis/ticket/3496" href="https://trac.osgeo.org/postgis/ticket/3496" target="_blank" rel="noopener"&gt;#3496 (Make postgis non-relocateable and schema qualify at least core functions (extension installs)) – PostGIS&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Sep 2022 18:45:41 GMT</pubDate>
    <dc:creator>The_Right_Honorable_MatthewSyp</dc:creator>
    <dc:date>2022-09-09T18:45:41Z</dc:date>
    <item>
      <title>Support PostgreSQL connection without "public" schema</title>
      <link>https://community.esri.com/t5/data-management-ideas/support-postgresql-connection-without-quot-public/idi-p/935406</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Support PostgreSQL/PostGIS connections without a default "public" schema.&lt;/STRONG&gt;&amp;nbsp; As of 10.4.1, ArcGIS still is not able to connect to a PostgreSQL database if PostGIS is installed in a different schema.&amp;nbsp; In the modern database landscape, this would appear not only as a limitation but as a defect.&amp;nbsp; It is certainly not a valid reason for requiring refactoring or creating one's database to accommodate such a narrow implementation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ArcGIS can and should easily be able to connect to PostgreSQL/PostGIS installations and data in any schema, even if no "public" schema exists at all.&amp;nbsp; It is a default schema on the server but not required; it can be and often is renamed or deleted like any other schema.&amp;nbsp; Some DB admins automatically remove it and the "public" user/role as a basic matter of security &lt;EM&gt;because&lt;/EM&gt; it is a default.&amp;nbsp; Starting with version 2.3.0 (released Sept 26, 2016), PostGIS installation is non-relocatable into the "postgis" schema.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see two immediate, straight &lt;SPAN&gt;forward&lt;/SPAN&gt; implementations (I'm sure there are others):&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Rely on the &lt;SPAN&gt;search_path&lt;/SPAN&gt; variable, as most probably do in their other PostGIS interactions, and do not specify a schema with the PostGIS calls, or&lt;/LI&gt;&lt;LI&gt;Ask the user to specify the schema into which PostGIS is installed.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In any case, all explicit references to or dependencies on the "public" schema should be removed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;REFERENCES&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Example of problem:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/174833" target="_blank" rel="noopener"&gt;Errors when postgis extension (PostgreSQL) is installed in a schema other than "public".&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error message:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Failed to connect to the specified server. Do you want to continue?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Underlying DBMS error[ERROR: schema "public" does not exist&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LINE 1: SELECT public.postgis_lib_version()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;^SQL state: 3F000]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;PostGIS non-relocatable:&lt;BR /&gt;&lt;A title="http://postgis.net/2016/09/26/postgis-2.3.0/" href="http://postgis.net/2016/09/26/postgis-2.3.0/" target="_blank" rel="noopener"&gt;PostGIS — PostGIS 2.3.0 Released&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A title="https://trac.osgeo.org/postgis/ticket/3496" href="https://trac.osgeo.org/postgis/ticket/3496" target="_blank" rel="noopener"&gt;#3496 (Make postgis non-relocateable and schema qualify at least core functions (extension installs)) – PostGIS&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 18:45:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-ideas/support-postgresql-connection-without-quot-public/idi-p/935406</guid>
      <dc:creator>The_Right_Honorable_MatthewSyp</dc:creator>
      <dc:date>2022-09-09T18:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: Support PostgreSQL connection without "public" schema</title>
      <link>https://community.esri.com/t5/data-management-ideas/support-postgresql-connection-without-quot-public/idc-p/935407#M873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still no change in ArcGIS Pro 2.1.2.&amp;nbsp; Same error message. A support case with Esri resulted in a declaration that the "public" schema is required: "&lt;SPAN style="font-size: 12.0pt;"&gt;ArcGIS requires the public schema to be in place for a user other than that data owner to connect.&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The part about a user other than the data owner does not appear to be correct, because I was connecting as the owner and superuser.&amp;nbsp; Simply adding a schema called public does not solve the problem; it only changes the connection error to:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;A database connection exception has occurred.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;Function or procedure does not exist.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The database log shows that it was trying to run the same query:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;SELECT public.postgis_lib_version()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;(There is also a query for "select count(*) from sde.sde_layers" with the same result which ArcGIS may be ignoring.)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;So ArcGIS currently requires that PostGIS be installed in a schema called "public".&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.postgresql.org/docs/9.5/static/ddl-schemas.html"&gt;PostgreSQL documentation&lt;/A&gt; explicitly says:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;There is nothing special about the public schema except that it exists by default. It can be dropped, too.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;And later in the same document:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;...there is no concept of a &lt;SPAN style="font-size: 10.0pt;"&gt;public&lt;/SPAN&gt; schema in the SQL standard. For maximum conformance to the standard, you should not use the &lt;SPAN style="font-size: 10.0pt;"&gt;public&lt;/SPAN&gt; schema.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Apr 2018 17:03:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-ideas/support-postgresql-connection-without-quot-public/idc-p/935407#M873</guid>
      <dc:creator>The_Right_Honorable_MatthewSyp</dc:creator>
      <dc:date>2018-04-24T17:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: Support PostgreSQL connection without "public" schema - Status changed to: Closed</title>
      <link>https://community.esri.com/t5/data-management-ideas/support-postgresql-connection-without-quot-public/idc-p/1219150#M1975</link>
      <description>&lt;P&gt;Thanks for the idea!&lt;BR /&gt;&lt;BR /&gt;Esri has supported installing PostGIS in schemas other than PUBLIC since 2.3/10.7. This limitation was addressed thanks to the contributions of users like yourselves!&lt;/P&gt;&lt;P&gt;Esri does store sde_spatial_references in the Public schema. This is to support select access to all users. ESRI does not support renaming or dropping the Public schema.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/manage-postgresql/geodatabase-system-tables-postgresql.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/manage-postgresql/geodatabase-system...&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 22:12:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-ideas/support-postgresql-connection-without-quot-public/idc-p/1219150#M1975</guid>
      <dc:creator>SSWoodward</dc:creator>
      <dc:date>2022-10-05T22:12:36Z</dc:date>
    </item>
  </channel>
</rss>

