Select to view content in your preferred language

Cannot register postgres table

1379
4
Jump to solution
10-07-2022 06:21 AM
Labels (1)
RiccardoKlinger
Frequent Contributor

Dear ESRI Community,

 

We have some tables in our postgres database. the tables were creted like:

 

CREATE TABLE IF NOT EXISTS gd_base.polygon
(
objectid integer NOT NULL,
name character varying(255) COLLATE pg_catalog."default",
shape geometry(Polygon,32632) NOT NULL,
status integer NOT NULL,
created_user character varying(255) COLLATE pg_catalog."default",
created_date timestamp without time zone,
last_edited_user character varying(255) COLLATE pg_catalog."default",
last_edited_date timestamp without time zone,
)

Unfortunately we face an issue as it states:

RiccardoKlinger_0-1665148482809.png

After, I have dropped the NOT NULL constraint using dataGrip and retried the same process it was resulting in the same issue. But the column was again marked with "NOT NULL".

After that I also removed the objectid column from the table and rerun the process, leaving the field to be used as objectid empty.

The same problem appeared. We are lost...

 

Tried with ArcGIS Por 2.9/2.8 Arcmap 10.8.1, ArcPY running on postgres12 with postgis and sde extension.

0 Kudos
1 Solution

Accepted Solutions
RiccardoKlinger
Frequent Contributor

If someone faces similar problems:

We've removed the "NOT NULL" constraint from the shape column and it is now working. We can register our tables with an already defined objectid column and with no defined objectid column.

View solution in original post

4 Replies
RiccardoKlinger
Frequent Contributor

If someone faces similar problems:

We've removed the "NOT NULL" constraint from the shape column and it is now working. We can register our tables with an already defined objectid column and with no defined objectid column.

RiccardoKlinger
Frequent Contributor
0 Kudos
VinceAngelo
Esri Esteemed Contributor

If you use objectid serial NOT NULL in the table declaration, ArcGIS will know how to deal with it at registration.

- V 

0 Kudos
RiccardoKlinger
Frequent Contributor

Hi @VinceAngelo , yes, it will recognize it, which is a desired behaviour. But still: if the SHAPE column is set to NOT NULL, the process itself is not working and giving the above error message. It would be VERY good to rewrite the error message and tell the user:

SHAPE column must not have a NOT NULL constraint

instead of:

The column must not have a NOT NULL constraint

0 Kudos