Getting started with PostgreSQL

The PostgreSQL modules let you execute your custom logic directly in your database server through functions. Integromat loads interface of input and output parameters dynamically so each parameter can be mapped individually.


Here is a sample SQL statement that creates a function that just simply inserts the values passed in the three parameters into a table:

CREATE OR REPLACE FUNCTION insert_record_from_integromat(_name character varying,_email character varying, _phone character varying)
LANGUAGE 'plpgsql'
INSERT INTO contacts (name, email, phone) VALUES (_name, _email, _phone);

To learn more about creating functions, see PostgreSQL documentation.

Configuring your PostgreSQL server

Make sure the account you're using to connect to your database has read access to 'information_schema.routines' and 'information_schema.parameters' tables.

Integromat will make connections to your database from the following IP range: Our servers are set up with valid PTR records so you can easily restrict access by allowing *


ER_LOCK_WAIT_TIMEOUT: Lock wait timeout exceeded; try restarting transaction

This error occurs when you modify the same data using multiple modules. It is caused by SQL transactions.

When any SQL module is executed then it starts the transaction (1) and the transaction is finished after the scenario is fully executed.
If another module tries to access the same data used in another unfinished transaction (1) then it has to wait until the previous transaction (1) is finished – but it never happens because the first transaction (1) will be finished after the scenario is finished.


Turn on Auto-commit. It finishes (commits) every transaction immediately after the module execution is done.

1. Open Scenario settings.

2. Enable the Auto commit checkbox.

3. Confirm the settings dialog by clicking the OK button.




Popular use cases from our blog


How to Automate Data Collection - Part 5: CRM Systems


How to Automate Data Collection - Part 4: Chatbot Marketing


How to Automate Data Collection - Part 3: Paid Ads


How to Automate Data Collection - Part 2: Email Marketing Segmentation


5 Automated Solutions to Personalize Customer Experience


How to Automate Data Collection - Part 1: Online Forms

Didn’t find what you were looking for?


Find an expert

We feature a network of 450+ certified partners across the globe who are ready to help

Find an expert

Automate any workflow in your business

Sign up for a free account today. No credit card required, no time limits on free plan.