Solved

Problem to insert features into PostGis table

  • 13 April 2024
  • 4 replies
  • 44 views

Badge +1

Hi,

I would like to populate the "public.pdl_steg" table in PostgreSQL/PostGis with features from a "pdls" shapefile layer. public.pdl_steg includes triggers in some fields.

The id_pdls field is of the serial type.
The code_pdls field is unique.

 

 

 

The triggers work well in PostGis et QGIS.

 

Shapefile “pdls” table:


However, after several attempts, I was unable to add the features from the "pdls" layer to "public.pdl_steg". The execution does not emit any errors and nothing happens.

Any help is welcome.

icon

Best answer by gennine 21 April 2024, 22:56

View original

4 replies

Userlevel 2
Badge +8

Hi @gennine 

 

It looks like you have set the starting feature to 3 and because you are only writing 2 features, FME is likely skipping over those 2 features before writing to PostGIS. 

 

If you set the starting feature to 1 this should hopefully fix the issue. 

 

Crystal 

Badge +1

Unfortunatly @cfitzpat, I tried with 1 and 0 but nothing happens and the two features are not added to the database.

 

Userlevel 2
Badge +8

Hi @gennine 

 

A few more things you could try would be to, first, enable to log debug mode - this will give you more information in the translation log. 

Select Tools > FME Options > Translation > Log Message Filter

Check the "Log Debug" option

Click OK to close the FME Options dialog

 

Also, try disabling bulk insert in the essai [POSTGIS] parameters. 

Lastly, instead of embedding SQL in the writer I would try to execute that SQL script before the writer using an SQLExecutor Transformer. This will just check to see if that script might be causing any error and provide more information in the translation log. 

 

If there is an error, please consider sharing the logfile so we can take a closer look. 

 

Crystal

 

Badge +1

Many thanks @cfitzpat for your interest to my question.

In fact, I have noticed that the shapefile “pdls” from QGIS is of type multipolygon and the table in PostGis “public.pdl_steg” is of type polygon. So, When I have transformed “pdls” to polygon with “FeatureWriter”, the workbench works very well.

Reply