You can connect your PostgreSQL database to Ubiq in just 4 steps. Please replace the parts in bold below as per your requirement.
Log into PostgreSQL database (e.g $mydb) with an admin/owner username (e.g postgres) and create a unprivileged User (username - $readonlyuser, password - $password)
$ psql -U postgres $mydb
$mydb=# CREATE ROLE $readonlyuser password '$password' NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;
Grant usage & select permissions for your read-only user ($schema is generally 'public') to all tables in $mydb database.
$mydb=# GRANT USAGE ON SCHEMA $schema TO $readonlyuser;
$mydb=# GRANT SELECT ON ALL TABLES IN SCHEMA $schema TO $readonlyuser;
Add the following line
For more information about this file, please refer here. $mydb is the database name, $readonlyuser is the username & $password is the password to be provided in the Create Connection form below.
When you click on Create Connection on the Data Sources tab, on project homepage, you will see the following form.
Select the type of database you want to create a connection for. The form has the following fields:
Please ensure the host name, database name, user name, password & port are entered correctly before you click Connect. On successful connection, you will see the data source listed under the Data Sources Tab. In case of issues, you will see an intuitive message on the form.