PostgreSQLDataWriter

Not available in Community Designer

Short Description
Ports
Metadata
PostgreSQLDataWriter Attributes
Details
See also

Short Description

PostgreSQLDataWriter loads data into PostgreSQL database.

Component Data output Input ports Output ports Transformation Transf. required Java CTL Auto-propagated metadata
PostgreSQLDataWriterdatabase0-10
no
no
no
no
no

Icon

Ports

Port typeNumberRequiredDescriptionMetadata
Input0 [1] Records to be loaded into the databaseAny

[1] If no file containing data for loading (Loader input file) is specified, input port must be connected.

Metadata

PostgreSQLDataWriter does not propagate metadata.

PostgreSQLDataWriter has no metadata templates.

PostgreSQLDataWriter Attributes

AttributeReqDescriptionPossible values
Basic
Path to psql utilityyesName of psql utility, including path. Must be installed and configured on the same machine where CloverETL runs. Psql command line tool must be available. 
Host Host where database server is located.localhost (default) | other host
DatabaseyesName of the database into which the records should be loaded. 
Database tableyesName of the database table into which the records should be loaded. 
User name 

PostgreSQL username to be used when connecting to the server.

If empty, username of current user is used.

 
Advanced
Fail on error By default, graph fails upon each error. If you want to have the standard behavior of PostgreSQL database, you need to switch this attribute to false. If set to false, graph will run successfully even with some errors as it happens with PostgreSQL database. true (default) | false
Path to control script Name of command file containing the \copy statement, including path. See Path to Control Script for more information. 
Column delimiter  Delimiter used for each column in data. Field values must not include this delimiter as their part. tabulator character (default in text mode) | comma (default in CSV mode)
Loader input file Name of input file to be loaded, including path. See Loader Input File for more information. 
Parameters All parameters that can be used as parameters by the psql utility or the \copy statement. These values are contained in a sequence of pairs of the following form: key=value, or key only (if the key value is the boolean true) separated from each other by semicolon, colon, or pipe. If the value of any parameter contains semicolon, colon, or pipe as its part, such value must be double quoted.  

Details

PostgreSQLDataWriter loads data into database using PostgreSQL database client.

PostgreSQLDataWriter can read data through the input port or from an input file. If the input port is not connected to any other component, data must be contained in an input file that should be specified in the component.

[Important]Important

PostgreSQL client utility (psql) must be installed and configured on the same machine where CloverETL runs.

PostgreSQLDataWriter is a bulk loader suitable for uploading many records to database. To insert several records, you can also use DBOutputTable, which does not require psql utility.

Path to Control Script

Name of command file containing the \copy statement, including path.

  • If it is not set, command file is created in Clover temporary directory and it is deleted after the load finishes.

  • If it is set, but the specified command file does not exist, temporary file is created with the specified name and path and it is not deleted after the load finishes.

  • If it is set and the specified command file exists, this file is used instead of the file created by Clover. The file is not deleted after the load finishes.

Loader Input File

Name of input file to be loaded, including path.

  • If input port is connected and this file is not set, no temporary file is created. Data is read from the edge and loaded into database directly.

  • If it is set, specified file is created. It is not deleted after data is loaded and it is overwritten on each graph run.

  • If input port is not connected, this file must exist and must contain data that should be loaded into database. It is not deleted nor overwritten on another graph run.

[Important]Important

Utility psql.exe gets stuck due to asking for password interactively. To avoid the problem, the file .pgpass needs to be set up correctly.

On Windows you need to create file %APPDATA%\postgresql\pgpass.conf.

On Unix/Linux you need to create file ~/.pgpass. The file has to have permissions 0600.

The file content is in the following format:

hostname:port:database:username:password

for example:

postgresql.example.com:5432:mydatabase:user1:Pns2kj@Dat

See corresponding PostgreSQL documentation (http://www.postgresql.org/docs/9.4/static/libpq-pgpass.html) for more details.

Notes and Limitations

You should not write lists and maps.

See also

DBOutputTable
Common Properties of Components
Specific Attribute Types
Common Properties of Writers
Writers Comparison