Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

On this page

Table of Contents
maxLevel2
absoluteUrltrue

Overview

Use this account type to connect PostgreSQL Snaps with data sources that use PostgreSQL accounts.

Prerequisites

None.

Account Settings

Image RemovedImage Added

Parameter NameData TypeDescriptionDefault ValueExample 
LabelStringUnique name for the account.N/APostgreSQL_Account_Type
Account propertiesNA

Required.Enter here the information needed to create a connection to the database.

N/AN/A

Hostname

StringRequired.The address of the PostgreSQL server to which you want to connect.N/A"acc-postgresql-us-easttest-rdsrsd.amazonaws.com"

Port Number

IntegerRequired.The port number that you want to use to connect to the PostgreSQL database.330612341212

Database name

StringRequired.The name of the database to which you want to connect.N/ATestDB

Username

StringThe username that is allowed to connect to the database. This will be used as the default username when retrieving connections.N/Atestaccount

Password

StringThe password associated with the username that you want to use to connect to your account. This password will be used as the default password when retrieving connections.N/AN/A

JDBC Jars

N/AThe list of JDBC jar files that must be loaded for the account to work.N/AN/A

JDBC Driver

String

The JDBC driver must be loaded for the account to work. When you do not provide a driver, the default Postgres driver is used. (Default driver: postgres 9.4.1207.jar)

N/Apostgresql-9.4.1207.jar

JDBC Driver Class

StringThe JDBC driver class that you want to use with the account.org.postgresql.DriverN/A

Configure SSH Tunnel


Checkbox

Select this checkbox if Snap needs to create an SSH tunnel for connecting the Snaplex to the PostgreSQL server. After the operation is completed, the tunnel is closed.

If you select this checkbox, you must provide the configuration details on the SSH tunnel.

Learn more about Setting Up SSH Tunneling with PostgreSQL.

DeselectedFalse

SSH Auth Mode


Dropdown list

Select an option to specify the mode for authenticating the user on the SSH tunnel. The available options are:

  • Password: Select this option if you want to use the configured SSH Hostname, SSH Username, and the SSH Password properties directly.

  • KeyFile (Private Key File): Select this option if you want to upload a file for the Key.

  • KeyFile (Private Key String): Select this option if you want to copy and paste the private key contents into the account.

This value is considered only if the Configure SSH Tunnel checkbox is selected.

PasswordKeyFile

SSH Hostname


String

Specify the IP address or the domain name of the SSH server to which you want to connect.

None127.0.0.1

SSH Username


String

Specify the SSH username for connecting to the tunnel. 

NoneSSHUser

SSH Password


String

Specify the password for the specified SSH username for connecting to the SSH tunnel. This field is required if SSH Auth Mode is Password

None<Encrypted>

Private Key File URL


String/Expression

Specify the location of the keystore file. This field is required if SSH Auth Mode is KeyFile (Private Key File).

The file can be in SLDB, on the host machine that is hosting the JCC, or at any other remote location. For a local file, click to select the appropriate file using the file browser. You can also upload the file using any protocol such as https, ftp, sldb, and sftp.

Nonepostgres-ssh.pem

Private Key


String

Specify the private key for authentication. This field is required if SSH Auth Mode is KeyFile (Private Key String).

None-----BEGIN RSA PRIVATE KEY-----

………………..

-----END RSA PRIVATE KEY-----

Private Key Passphrase 

String

Specify the password that is to be used to decrypt the private key. This field is required if SSH Auth Mode is KeyFile.

None:y<>6[[]gMssb^rM

SSH Port


Integer

Specify the SSH port to connect to the PostgreSQL Server.

Note

Ensure that there are no port conflicts.


None

222

Advanced PropertiesN/AAdvanced properties associated with the PostgreSQL account type.N/AN/A

Auto commit

Check box

Select this check box to commit each batch of processed data immediately after execution. If the Snap fails, only the batch being executed at that moment is rolled back.

Deselect this check box to commit processed data only after all the batches are executed. If the Snap fails, the entire transaction is rolled back, unless the Snap finds invalid input data before it sends the insert request to the server and routes the error documents to the Error view.

SelectedN/A

Batch size

Integer

Required. The number of statements to execute at a time.

Note
Select queries are not batched.


Warning

Using a large batch size could use up the JDBC placeholder limit of 2100.


5020

Fetch size

Integer

Required.The number of rows to fetch at a time when executing a query.

Warning

Large values could cause the server to run out of memory.


10050

Max pool size

IntegerRequired. The maximum number of connections that a pool will maintain at a time.5030

Max life time

IntegerRequired. The maximum lifetime (in minutes) of a connection in the pool. Ensure that the value you enter is a few seconds shorter than any database or infrastructure-imposed connection time limit. A value of 0 indicates an infinite lifetime, subject to the Idle Timeout value. An in-use connection is never retired. Connections are removed only after they are closed.3050

Idle Timeout

IntegerRequired. The maximum amount of time (in minutes) that a connection is allowed to sit idle in the pool. A value of 0 indicates that idle connections are never removed from the pool.510

Checkout timeout

Integer

Required. The number of milliseconds to wait for a connection to be available when the pool is exhausted. Zero waits forever. The Snap throws an exception after the wait time has expired.

Info

If you provide 0, the Snap waits infinitely until the connection is available. Therefore, we recommend you not to specify 0 for Checkout Timeout.


100008000
URL propertiesFieldsetUse this fieldset to specify properties associated with the URL created to make the connection with your account.N/AN/A

URL property name

StringThe name of the URL property.N/AsocketTimeout

URL property value

stringThe value associated with the URL property listed in the URL property name field.N/A10

Limitations

None

Troubleshooting

ErrorReason Resolution

When you set up a PostgreSQL 15.3 (RDS), with the default driver (9.4.1207 ), the Snap fails with the following fatal error:

no pg_hba.conf entry for host "<hostname>", user "<username>", database "<database_name>", no encryption

The PostgreSQL server versions after 9.4.1207 may not be compatible with the default bundled PostgreSQL JAR in the Snap. 

Explicitly upload and use a recent JDBC driver. 42.5.2 or 42.6.0

You can download the latest JAR file from here: https://jdbc.postgresql.org/download


Excerpt

JDBC Driver Hangs in Case of Connection Error

The default socketTime value in PostgreSQL accounts is 0; this causes the JDBC driver to hang if there are any connection errors. To overcome this, configure the URL properties in Account settings with the following parameter and value:


URL property name
URL property value
socketTimeout10

A SocketTimeout value of 10 ensures that the JDBC driver returns no connections after 10 seconds.

Timeout Issue

A connection failure does not suspend the running PostgreSQL Pipelines if the timeout value is lesser than the time to process the query. To overcome this issue, set the URL property socketTimeout with a longer time period than that of the longest expected query.

URL property nameURL property value
socketTimeout<time in seconds>

SSL Connection - Validation Issue

When connecting to an SSL enabled PostgreSQL account, the account fails in validation. To overcome this, configure the URL properties in Account settings to establish an SSL connection with the following parameter and value:

URL property nameURL property value
sslmoderequire

Auto Commit with Execute Snaps

For a DB Execute Snap, assume that a stream of documents enters the input view of the Snap and the SQL statement property has JSON paths in the WHERE clause. If the number of documents is large, the Snap executes in more than one batches rather than executing one per each document. Each batch would contain a certain number of WHERE clause values. If Auto commit is turned on, a failure would only roll back the records in the current batch. If Auto commit is turned off, the entire operation would be rolled back. For a single execute statement (with no input view), the setting has no practical effect.


Snap Pack History

Insert excerpt
PostgreSQL Snap Pack
PostgreSQL Snap Pack

...