PostGIS Writer Parameters
About Database Connections |
---|
Database formats include a Database Connection parameter that defines and stores authentication information. For general information about sharing database connections, please see Using Database Connections. Note that Database Connection parameters differ slightly, depending on context and/or database format. |
Connection From the Connection parameter in a database format, you can do one of the following:
|
Database Connection
Select an existing PostgreSQL database connection, or Add Database Connection...
Add PostGIS/PostgreSQL Database Connection To define a new connection from the Connection parameter in a PostGIS format, see the topic PostGIS: Add Database Connection. |
Table Creation
Spatial Column Type
Select either geography or geometry columns for the table.
Spatial Column
Enter a name for the table.
Create Generic Geometry Columns
This setting applies at generation time, not at translation time. The default setting of "no" indicates that you want to create geometrically constrained geometry columns on the destination tables. For example, a POINT geometry table would be restricted only to points. Now you 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.
Lower Case Attribute Names
If checked, changes the case of attribute names to lowercase.
Advanced
No – The writer inserts data into the database using SQL INSERT statements.
Yes – The writer inserts data using the SQL COPY command, which yields better performance.
This parameter is enabled when Bulk Insert is set to No.
- Insert null – The writer inserts NULL values for column values if attributes are missing or NULL on incoming features.
- Insert column default value – The writer inserts the default value for a column when the incoming feature has a missing or NULL attribute.
The OpenGIS specification defines two standard ways of expressing spatial objects: the Well-Known Text (WKT) form and the Well-Known Binary (WKB) form. Both WKT and WKB include information about the type of the object and the coordinates that form the object.
When sending geometry to the database, WKB is the usual encoding method, since it is faster and it supports larger geometries. In rare cases, however, some users may have a requirement to insert WKT.
The number at which the writer will start writing features into the database. The writer skips the number of features in this parameter, and then it begins writing the features that follow.
Usually, the value specified is 0 (which is the default) – a non-zero value is usually only specified when a data load operation is being resumed after failing partway through.
The number of features that FME places in each transaction before a transaction is committed to the database. (Note that VARIABLE is an accepted value, to work with the fme_db_transaction attribute.)
The default value is 1000.
This parameter allows for the execution of SQL statements before writing to a table. For example, it may be necessary to clean up a table before attempting to write to it. The statements will be executed only when the first feature arrives at the writer.
For detailed information about SQL functions, click the corresponding menu item in the
.Available menu options depend on the format.
Multiple SQL commands can be delimited by a character specified using the FME_SQL_DELIMITER
directive, embedded at the beginning of the SQL block. The single character following this directive will be used to split the SQL block into SQL statements, which will then be sent to the database for execution. Note: Include a space before the character.
For example:
FME_SQL_DELIMITER ; DELETE FROM instructors ; DELETE FROM people WHERE LastName='Doe' AND FirstName='John'
Multiple delimiters are not allowed and the delimiter character will be stripped before being sent to the database.
Any errors occurring during the execution of these SQL statements will normally terminate the reader or writer (depending on where the SQL statement is executed) with an error. If the specified statement is preceded by a hyphen (“-”), such errors are ignored.
This parameter allows for the execution of SQL statements after a set of tables has been written. For example, it may be necessary to clean up a temporary view after creating it.
For detailed information about SQL functions, click the corresponding menu item in the
.Available menu options depend on the format.
Multiple SQL commands can be delimited by a character specified using the FME_SQL_DELIMITER
directive, embedded at the beginning of the SQL block. The single character following this directive will be used to split the SQL block into SQL statements, which will then be sent to the database for execution. Note: Include a space before the character.
For example:
FME_SQL_DELIMITER ; DELETE FROM instructors ; DELETE FROM people WHERE LastName='Doe' AND FirstName='John'
Multiple delimiters are not allowed and the delimiter character will be stripped before being sent to the database.
Any errors occurring during the execution of these SQL statements will normally terminate the reader or writer (depending on where the SQL statement is executed) with an error. If the specified statement is preceded by a hyphen (“-”), such errors are ignored.