PostgreSQL Insert Writer - Haufe-Lexware/haufe.no-frills-transformation GitHub Wiki
In order to insert data on a PostgreSQL Server database, use the following target definition:
<Target config="[configuration]">postgres.insert://table_name</Target>The PostgreSQL Update Writer will attempt to insert the records into the table_name (the name of the table to insert data to). It will do a best effort to map the output fields to the actual SQL Server records.
For the configuration, there are two possibilities:
- Using a connection string directly
- Using a connection string which is located in a text file
Pass the connection string directly into the configuration of the source tag:
<Target config="Host=myServerAddress;Database=myDataBase;User ID=myUsername;Password=myPassword;">postgres.insert://CreditStatements</Target>Parameters can be used inside the connection string, if needed.
Please note the use the substitution of the greater (>, >) operator in the SQL query (needed for XML compliance).
In order to read the connection string from a file, use the following syntax (using the @ character):
<Target config="@postgres_connection.txt">postgres.insert://Contacts</Target>Sample content of the postgres_connection.txt file, also using a parameter (§env§):
Host=§env§;Database=myDataBase-§env§;User ID=myUsername;Password=myPassword;