Skip to main content
Solved

Problem to insert features into PostGis table


gennine
Contributor
Forum|alt.badge.img+4

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.

Best answer by gennine

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.

View original
Did this help you find an answer to your question?

4 replies

crystalatsafe
Safer
Forum|alt.badge.img+19

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 


gennine
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • April 15, 2024

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

 


crystalatsafe
Safer
Forum|alt.badge.img+19

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

 


gennine
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • Best Answer
  • April 21, 2024

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings