Postgres

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.

Integration with LogicHub

Connecting with Postgres

To connect to Postgres following details are required:

  • Server Name or Hostname of Database: example, 192.168.1.1 or mydatabase.example.com
  • Username: Username for connecting to the database
  • Password: Password for connecting to the database
  • Port (Optional): Specify the port on which database server is listening, default is 5432
  • Schema/Database Name (Optional): Specify default database to connect

Actions with Postgres

Query

Query Postgres Database

Inputs to this Action:

  • Connection: Choose a connection that you have created
  • Query Template: Jinja2 Template e.g following are some examples
    • Select id, name from customers where city_id = {{city_id_column_name}}
    • {{query_column_name}}
    • Select id, date, amount from orders
    • Update customers set name = ‘new name’ where id = 3
      Here variables inside curly braces {{}} refer to the column of the parent node’s results table.

Output of Action:
If the query returns results, for example, select * from orders, the following will be the one row of the output

In case the query does not return results, for example, update customers set name = ‘new name’ where id = 3. The output would be the following:


Did this page help you?