<?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: Postgres sequences using feature service in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/postgres-sequences-using-feature-service/m-p/1225495#M8963</link>
    <description>&lt;P&gt;One thing you might consider is whether you can use&amp;nbsp;attribute rules to generate the sequence.&lt;/P&gt;&lt;P&gt;If you want to stick to the way you are doing it, you might create a registered view on the sequence table. Then you would add that view to your publishing map and republish it with your service.&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;--Rich&lt;/P&gt;</description>
    <pubDate>Tue, 25 Oct 2022 23:04:58 GMT</pubDate>
    <dc:creator>RichRuh</dc:creator>
    <dc:date>2022-10-25T23:04:58Z</dc:date>
    <item>
      <title>Postgres sequences using feature service</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/postgres-sequences-using-feature-service/m-p/1224497#M8943</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I'm developing an add-in where I'm using ArcGIS Feature Service from Portal that has one layer and some tables related to it. Data is in Postgres database. &lt;U&gt;I would like to know how to query sequence table&lt;/U&gt;. Does sequence table has to be added to service for that? Before starting to use feature service I queried sequences like in the code example below:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt; using (var tbl = f_layer.GetTable())
                    {
                        seqs = FaktikaUtils.GetAllSequences(tbl);
                    }  


public static List&amp;lt;string&amp;gt; GetAllSequences(Table Tbl)
        {
            List&amp;lt;string&amp;gt; seq_lst = new List&amp;lt;string&amp;gt;();
            using (Geodatabase gdb = Tbl.GetDatastore() as Geodatabase)
            {
                if (gdb.GetGeodatabaseType() == GeodatabaseType.RemoteDatabase))
                {
                    var conn = gdb.GetConnector() as DatabaseConnectionProperties;
                    if (conn.DBMS == EnterpriseDatabaseType.PostgreSQL)
                    {
                        QueryDef qd = new QueryDef
                        {
                            Tables = "information_schema.sequences",
                            SubFields = "sequence_name, sequence_catalog, sequence_schema"
                        };
                        using (RowCursor cur = gdb.Evaluate(qd, false))
                        {
                            while (cur.MoveNext())
                            {
                                using (Row row = cur.Current)
                                {
                                    seq_lst.Add($"{row["sequence_catalog"]}.{row["sequence_schema"]}.{row["sequence_name"]}");
                                }
                            }
                        }
                    }
                }
            }
            return seq_lst;
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Oct 2022 09:27:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/postgres-sequences-using-feature-service/m-p/1224497#M8943</guid>
      <dc:creator>kirken</dc:creator>
      <dc:date>2022-10-23T09:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: Postgres sequences using feature service</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/postgres-sequences-using-feature-service/m-p/1225495#M8963</link>
      <description>&lt;P&gt;One thing you might consider is whether you can use&amp;nbsp;attribute rules to generate the sequence.&lt;/P&gt;&lt;P&gt;If you want to stick to the way you are doing it, you might create a registered view on the sequence table. Then you would add that view to your publishing map and republish it with your service.&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;--Rich&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 23:04:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/postgres-sequences-using-feature-service/m-p/1225495#M8963</guid>
      <dc:creator>RichRuh</dc:creator>
      <dc:date>2022-10-25T23:04:58Z</dc:date>
    </item>
  </channel>
</rss>

