PostgreSQL

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.

Functions

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)
RETURNS void
LANGUAGE 'plpgsql'
AS $BODY$
BEGIN
INSERT INTO contacts (name, email, phone) VALUES (_name, _email, _phone);
END;
$BODY$;

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: 82.208.14.11082.208.14.119. Our servers are set up with valid PTR records so you can easily restrict access by allowing *.integromat.com.

Troubleshooting

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.

Solution

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.

Z938rEPHID.gif

 

 

Popular use cases from our blog

automated-data-collection-crm-illustration

How to Automate Data Collection - Part 5: CRM Systems

automated-data-collection-chatbot-marketing-illustration

How to Automate Data Collection - Part 4: Chatbot Marketing

automated-data-collection-paid-ads-illustration

How to Automate Data Collection - Part 3: Paid Ads

automated-data-collection-email-illustration

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

personalized-customer-experience-illustration-integromat

5 Automated Solutions to Personalize Customer Experience

data-collection-automation-forms-pt-1

How to Automate Data Collection - Part 1: Online Forms

Didn’t find what you were looking for?

Expert

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.