Writer Directives

The directives that are processed by the PostgreSQL writer are listed below. The suffixes shown are prefixed by the current <WriterKeyword>_ in a mapping file. By default, the <WriterKeyword> for the PostgreSQL writer is POSTGRES_OUT.

DATASET/DATABASE, HOST, PORT, USER_NAME, PASSWORD

These directives operate in the same manner as they do for the PostgreSQL reader.

START_TRANSACTION

Required/Optional: Optional

This statement tells the PostgreSQL writer module when to start actually writing features into the database. The PostgreSQL writer does not write any features until the feature number of features are skipped, and then it begins writing the following features. Normally, the value specified is zero – a non-zero value is only specified when a data load operation is being resumed after failing partway through.

POSTGRES_OUT_START_TRANSACTION 0

Workbench Parameter: Starting Feature

TRANSACTION_INTERVAL

Required/Optional: Optional

This statement informs the FME about the number of features to be placed in each transaction before a transaction is committed to the database.

If the POSTGRES_OUT_TRANSACTION_INTERVAL statement is not specified, then a value of 1000 is used as the transaction interval.

POSTGRES_OUT_TRANSACTION_INTERVAL 2000

Workbench Parameter: Features Per Transaction

BULK_COPY

Required/Optional: Optional

This statement tells the PostgreSQL writer module to insert data into the database using either SQL INSERT statements or the SQL COPY command. The default option is the bulk copy using the COPY command, which yields the best performance. The bulk delimiter is no longer user-adjustable – the escaping of it has improved and is no longer necessary as a backup measure. However, if individual inserts are desired, this option can be set to NO.

POSTGRES_OUT_BULK_COPY YES

Workbench Parameter: Bulk Insert

GENERIC_GEOMETRY

Required/Optional: Optional

This directive is unique in that it only applies at generation time and not at translation time. The default value of NO indicates that we want the previous behavior of creating geometrically constrained geometry columns on the destination tables. For example, a POINT geometry table would be restricted only to points. Now we have the option to create generic or non-constrained geometry column types.

Effectively this means you can insert multiple geometry types into one table. Specifically the geometry column is created to have the generic type GEOMETRY and there are no constraints placed on the geometry types allowed.

If the POSTGIS_OUT_GENERIC_GEOMETRY statement is not specified, a value of NO is given.

POSTGIS_OUT_GENERIC_GEOMETRY YES