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)
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:
22.214.171.124. 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.