<?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: Error When Adding Features to Map From Database Connection in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/error-when-adding-features-to-map-from-database/m-p/1662053#M99839</link>
    <description>&lt;P&gt;I am commenting to show a solution for those who have the privileges to add functions and are comfortable with PostgreSQL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;Within psql (PostgreSQL terminal) or pg Admin 4, create the following function:&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;CREATE OR REPLACE FUNCTION rename_columns_to_lowercase(
    p_schema_name TEXT,
    p_table_name TEXT
)
RETURNS VOID AS $$
DECLARE
    column_rec RECORD;
BEGIN
    FOR column_rec IN
        SELECT
            c.column_name
        FROM
            information_schema.columns c
        WHERE
            c.table_schema = p_schema_name
            AND c.table_name = p_table_name
            AND c.column_name &amp;lt;&amp;gt; lower(c.column_name)
    LOOP
        EXECUTE format('ALTER TABLE %I.%I RENAME COLUMN %I TO %I',
            p_schema_name,
            p_table_name,
            column_rec.column_name,
            lower(column_rec.column_name));
    END LOOP;
END;
$$ LANGUAGE plpgsql;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, you can call on that function to make all of the columns lowercase within a given table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;# Input in the form
# SELECT rename_columns_to_lowercase('schema', 'table');
SELECT rename_columns_to_lowercase('public', 'cv_parcels_county_extent')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After refreshing the connection within ArcGIS Pro, you should be able to add your data to the map. You might be prompted to select a primary key from one of your columns before you can add the table.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Oct 2025 21:04:18 GMT</pubDate>
    <dc:creator>MaxwellMiller_</dc:creator>
    <dc:date>2025-10-29T21:04:18Z</dc:date>
    <item>
      <title>Error When Adding Features to Map From Database Connection</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/error-when-adding-features-to-map-from-database/m-p/1662048#M99838</link>
      <description>&lt;P&gt;ArcGIS Pro 3.5.4&lt;/P&gt;&lt;P&gt;I have a PostgreSQL database with the PostGIS extension that I have connected to successfully and want to add features to the current map. I right click and select 'Add to Current Map' and I get the following error message.&amp;nbsp;&lt;/P&gt;&lt;P&gt;'Attribute column not found[ERROR; column "county" does not exist Line 1: select * from (select COUNTY, BOOK, MAP, PARCEL, SPLIT, ...'&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MaxwellMiller__0-1761770103492.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/142875i1247AE73BE943194/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MaxwellMiller__0-1761770103492.png" alt="MaxwellMiller__0-1761770103492.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I read somewhere on the ESRI forums that both the database column names need to be in lowercase. I would recommend that the error message be improved to detail that fact.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Oct 2025 20:54:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/error-when-adding-features-to-map-from-database/m-p/1662048#M99838</guid>
      <dc:creator>MaxwellMiller_</dc:creator>
      <dc:date>2025-10-29T20:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: Error When Adding Features to Map From Database Connection</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/error-when-adding-features-to-map-from-database/m-p/1662053#M99839</link>
      <description>&lt;P&gt;I am commenting to show a solution for those who have the privileges to add functions and are comfortable with PostgreSQL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;Within psql (PostgreSQL terminal) or pg Admin 4, create the following function:&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;CREATE OR REPLACE FUNCTION rename_columns_to_lowercase(
    p_schema_name TEXT,
    p_table_name TEXT
)
RETURNS VOID AS $$
DECLARE
    column_rec RECORD;
BEGIN
    FOR column_rec IN
        SELECT
            c.column_name
        FROM
            information_schema.columns c
        WHERE
            c.table_schema = p_schema_name
            AND c.table_name = p_table_name
            AND c.column_name &amp;lt;&amp;gt; lower(c.column_name)
    LOOP
        EXECUTE format('ALTER TABLE %I.%I RENAME COLUMN %I TO %I',
            p_schema_name,
            p_table_name,
            column_rec.column_name,
            lower(column_rec.column_name));
    END LOOP;
END;
$$ LANGUAGE plpgsql;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, you can call on that function to make all of the columns lowercase within a given table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;# Input in the form
# SELECT rename_columns_to_lowercase('schema', 'table');
SELECT rename_columns_to_lowercase('public', 'cv_parcels_county_extent')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After refreshing the connection within ArcGIS Pro, you should be able to add your data to the map. You might be prompted to select a primary key from one of your columns before you can add the table.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Oct 2025 21:04:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/error-when-adding-features-to-map-from-database/m-p/1662053#M99839</guid>
      <dc:creator>MaxwellMiller_</dc:creator>
      <dc:date>2025-10-29T21:04:18Z</dc:date>
    </item>
  </channel>
</rss>

