Solved

Writing to specific schema in PostGIS database

  • 14 November 2012
  • 5 replies
  • 79 views

Badge
Morning all,

 

 

I am loading a set of shapefiles into a PostGIS database using a shapefile reader and a PostGIS writer. If I accept the default workbench created by FME the data gets written to the public schema.  Where/how can I set the schema in the writer that I actually want the data written to?  Probably a simple solution...

 

 

FME Desktop 2012 sp3 and PostgreSQL 9.1 with PostGIS 2.0

 

 

Thanks
icon

Best answer by brendan 14 November 2012, 10:40

View original

5 replies

Badge
I can't check at the moment, but I believe in the PostGIS writer properties you set the "Database Username" to the PostGIS schema name.

 

The answer to your question can be found in the link below;

 

http://fmepedia.safe.com/articles/Error_Unexpected_Behavior/In-the-Postgis-Postgres-reader-tables-from-a-different-schema-don-t-show-up

 

 

I have used it before and it worked.
Badge
Thanks Brendan, that was it - database username should be the database schema you want to write to.
Badge

Hi,

Supplementing this answer with FME 2015 guidelines:

To write data in a different schema within a PostgreSQL or PostGIS database you need to type the schema name within the the PostgreSQL or the PostGIS database writer under the "General" tab and within the "Table Qualifier" form.

Userlevel 4
Badge +13

Just had this question myself and this is how I fixed this: just add the schema<dot> in front of your table name, which can be parameterized or filled with attribute value.

schema.mytable

Reply