Select to view content in your preferred language

ArcGIS.Core.Data.Table GetDefinition not working with postgres on Pro v3.2

1980
11
01-03-2024 05:08 AM
GeoffY
by
Emerging Contributor

I am using the ArcGis Pro SDK 3.0.0.36056 on our latest Add-In.

To support some functionality I have been utilising ArcGIS.Core.Data.Table GetDefinition method. This fails when the add-in is used with Pro v3.2, and Postgres. I have tried different versions of postgres and all have the same error:

The operation is not supported by this implementation.
at ArcGIS.Core.Data.Dataset.GetDefinitionHandle()
at ArcGIS.Core.Data.FeatureClass.CreateDefinition()
at ArcGIS.Core.Data.Table.GetDefinition()

Does anyone know if this is a breaking change for version 3.2+, or a bug?

Many Thanks.

 

11 Replies
GKmieliauskas
Esri Regular Contributor

Hi,

I had similar issue with Database view on PostgreSql and registered case on Esri support site. It is still open.

Have you tried to install patch 3.2.1?

0 Kudos
GeoffY
by
Emerging Contributor

Hi,

Yes I installed 3.2.1 to no avail. On a separate machine I tried recompiling using the 3.2 SDK and that made no difference. I know with a bit of effort I could code around the problem and avoid using this method altogether, but my worry is that there could be other functionality that is unsupported for Postgres with future Pro versions.

0 Kudos
GKmieliauskas
Esri Regular Contributor

At first, we have made workaround for reading table fields from cursor instead of table definition.

We decided to go back to SDK 3.1 for the same reason as you worry.

0 Kudos
GeoffY
by
Emerging Contributor

Yes, using the cursor for reading works well (at the moment). I was using it to get table field definitions, for a specific piece of functionality - will work my way around it another way. 

Hopefully someone at Esri will respond to one of our posts to give us some insight into this and future breaking changes, so that we can plan in advance.

0 Kudos
Aashis
by Esri Contributor
Esri Contributor

@GKmieliauskas @GeoffY - Could you please elaborate on the repro steps or provide sample codes? I could not reproduce the case on my machine. Table.GetDefinition works fine for Postgres.

0 Kudos
GKmieliauskas
Esri Regular Contributor

As I mentioned above, I have issue with database view not simple table.

It worked fine in versions before 3.2. 

Error: The operation is not supported by this implementation.


Code:

 

using (Table viewTable = geodatabase.OpenDataset<Table>(viewName))
{
    var tableDefinition = viewTable.GetDefinition();
    // other code with tableDefinition
}

 


I have attached print screen of database view properties window.

0 Kudos
GeoffY
by
Emerging Contributor

Similarly for me, the following worked before 3.2:

await QueuedTask.Run(() =>
{
 try
 {
  using (ArcGIS.Core.Data.Table t = _geodatabase.OpenDataset<ArcGIS.Core.Data.Table>(tableName))
  {
   TableDefinition td = t.GetDefinition();
   .....
  }
 }
 catch
 {
  throw;
 }
});
 
I have also tried this against Pro v3.2.1, and against several versions of postgres (11.7, 13.6, 15.3). All fine at 3.1 but not at 3.2.

 

 

0 Kudos
DaveFullerton
Frequent Contributor

Same problem, but with accessing a Query Feature Class with SQL Server.  I wrote the code using v3.2 against a feature class in a file geodatabase for quicker testing and that worked fine.  When I tried to move to production I got this same error with Table.GetDefintion().

ArcGIS.Core.Data.Exceptions.GeodatabaseGeneralException: The operation is not supported by this implementation.
---> System.Runtime.InteropServices.COMException (0x80040203): A syntax error occurred trying to evaluate a query string (0x80040203)
at ArcGIS.Core.Internal.IDatasetIOP.Dataset_GetDefinition(IntPtr datasetHandle)
at ArcGIS.Core.Data.Dataset.GetDefinitionHandle()
--- End of inner exception stack trace ---
at ArcGIS.Core.Data.Dataset.GetDefinitionHandle()
at ArcGIS.Core.Data.FeatureClass.CreateDefinition()
at ArcGIS.Core.Data.Table.GetDefinition()

0 Kudos
BryanTurcotte
New Contributor

Same problem here, we are trying to access to Table.GetDefinition() and get the same error but with an Oracle database for us, the same code was working on 3.1 and not anymore on 3.2.

Ticket have been created on ESRI side with code to reproduce the issue, waiting an answer about that.

0 Kudos