PostgreSQL
PostgreSQL is a powerful, open source object-relational database system that uses and extends the SQL language combined with many features that safely store and scale the most complicated data workloads.
Prerequisite credentials
You need a PostgreSQL account. By default, PostgreSQL restricts connections to hosts and networks included in the pg_hba.conf file. In case of restrictions you need to add the IP address used by DQO to Allowed IP Addresses in PostgreSQL Network Policies.
Adding PostgreSQL connection using the graphical interface
-
Go to Data Sources section and click + Add connection button in the upper left corner.
-
Select PostgreSQL database type.
Add connection settings.
PostgreSQL connection settings Property name in YAML configuration file Description Connection name The name of the connection that will be created in DQO. This will also be the name of the folder where the connection configuration files are stored. The name of the connection must be unique and consist of alphanumeric characters. Host host PostgreSQL host name. Supports also a ${POSTGRESQL_HOST} configuration with a custom environment variable. Port port PostgreSQL port name. The default port is 5432. Supports also a ${POSTGRESQL_PORT} configuration with a custom environment variable. Password password PostgreSQL database password. The value can be in the ${ENVIRONMENT_VARIABLE_NAME} format to use dynamic substitution. sslmode sslmode PostgreSQL sslmode parameter. The default value is disabled. See the PostgreSQL documentation for more information about using SSL. JDBC connection property Optional setting. DQO supports using JDBC driver to access PostgreSQL. See the PostgreSQL documentation for JDBC connection parameter references. DQO allows you to dynamically replace properties in connection settings with environment variables. To use it, simply change "clear text" to ${ENV_VAR} using the drop-down menu at the end of the variable entry field and type your variable.
For example:
To add optional JDBC connection properties just type the JDBC connection property and the Value. The value can be in the ${ENVIRONMENT_VARIABLE_NAME} format to use dynamic substitution.
For example:
To remove the property click on the trash icon at the end of the input field.
-
After filling in the connection settings, click the Test Connection button to test the connection.
- Click the Save connection button when the test is successful otherwise you can check the details of what went wrong.
-
Import the selected data resources (source schemas and tables) by clicking on the Import Tables button next to the name of the source schema from which you want to import tables.
-
Select the tables you want to import or import all tables using the buttons in the upper right corner.
Adding PostgreSQL connection using DQO Shell
To add a connection run the following command in DQO Shell.
Fill in the data you will be asked for.
Connection name (--name): connection1
Database provider type (--provider):
[ 1] bigquery
[ 2] snowflake
[ 3] postgresql
[ 4] redshift
[ 5] sqlserver
[ 6] mysql
[ 7] oracle
Please enter one of the [] values: 3
PostgreSQL host (--postgresql-host)[${POSTGRESQL_HOST}]: localhost
PostgreSQL port (--postgresql-port) [${POSTGRESQL_PORT}]: 65234
PostgreSQL user (--postgresql-user) [${POSTGRESQL_USER}]: testing
PostgreSQL password (--postgresql-password) [${POSTGRESQL_PASSWORD}]: xxx
Connection connecton1 was successfully added.
Run 'table import -c=connection1' to import tables.
You can also run the command with parameters to add a connection in just a single step.
dqo> connection add --name=connection1
--provider=postgresql
--postgresql-host=localhost
--postgresql-port=65234
--postgresql-user=testing
--postgresql-password=xxx
After adding connection run table import -c=connection1
to select schemas and import tables.
DQO will ask you to select the schema from which the tables will be imported.
You can also add the schema and table name as a parameter to import tables in just a single step.
DQO supports the use of the asterisk character * as a wildcard when selecting schemas and tables, which can substitute any number of characters. For example, use pub* to find all schema a name with a name starting with "pub". The * character can be used at the beginning, in the middle or at the end of the name.Connections configuration files
Connection configurations are stored in the YAML files in the ./sources
folder. The name of the connection is also
the name of the folder where the configuration file is stored.
Below is a sample YAML file showing an example configuration of the PostgreSQL data source connection.