> ## Documentation Index
> Fetch the complete documentation index at: https://docs.engini.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Postgres SQL

Learn how to seamlessly connect PostgreSQL to Engini, enabling efficient database integration for your workflows. With the PostgreSQL connector, you can manage data, run queries, and automate database interactions directly in Engini. Enhance productivity by integrating PostgreSQL's powerful capabilities into your business processes.

## Getting Started with Postgres SQL

### Prerequisites

* **A PostgreSQL account:** This includes the username and password to access the database.

## Connecting Engini to Postgres SQL

1. Enter your Engini account at [https://app.engini.io.](https://app.engini.io/)

2. Navigate to Connections page by clicking on the Connections on the left side bar or by clicking [here](https://app.engini.io/connections).

   <img src="https://mintcdn.com/engini/_MSo-hm6zXTakHQg/help/assets/apps/postgres-sql/jCvVivzV6W4XgI5Dez6NE_home-page-connector.png?fit=max&auto=format&n=_MSo-hm6zXTakHQg&q=85&s=0cee4a22e4f1424dfe16ad8de3b1555c" alt="" width="1920" height="1080" data-path="help/assets/apps/postgres-sql/jCvVivzV6W4XgI5Dez6NE_home-page-connector.png" />

3. Click on the "New Integration" option located at the top bar.

   <img src="https://mintcdn.com/engini/_MSo-hm6zXTakHQg/help/assets/apps/postgres-sql/Tc8OwXyO6hXXNLrpdVzA0_untitled-design-34.png?fit=max&auto=format&n=_MSo-hm6zXTakHQg&q=85&s=0d0498783669c852639d5435834928e1" alt="" width="1913" height="906" data-path="help/assets/apps/postgres-sql/Tc8OwXyO6hXXNLrpdVzA0_untitled-design-34.png" />

4. Choose Postgres SQL option from available applications.

   <img src="https://mintcdn.com/engini/_MSo-hm6zXTakHQg/help/assets/apps/postgres-sql/139SALM_6KdpFJYCEl1gm_untitled-design-35.png?fit=max&auto=format&n=_MSo-hm6zXTakHQg&q=85&s=c263b13bae35fcae28e93bb8a9edc043" alt="" width="1915" height="907" data-path="help/assets/apps/postgres-sql/139SALM_6KdpFJYCEl1gm_untitled-design-35.png" />

5. Enter the following details in the "New Integration" form:

   <img src="https://mintcdn.com/engini/_MSo-hm6zXTakHQg/help/assets/apps/postgres-sql/6UDpenV7m0hXZcMia2FYF_1-31.png?fit=max&auto=format&n=_MSo-hm6zXTakHQg&q=85&s=6f5aadd219f09cfcf0d08570b428c256" alt="" width="1920" height="1080" data-path="help/assets/apps/postgres-sql/6UDpenV7m0hXZcMia2FYF_1-31.png" />

   1. *Connection Name -* Choose a name for easy reference to this PostgreSQL connection.

   2. *Server Address -* The IP address or domain where the PostgreSQL server is hosted.

   3. *Database Name -* The name of the specific PostgreSQL database you want to connect to.

   4. *Schema -* The schema within the database, usually set to public if no other schema is specified.

   5. *Username -* The PostgreSQL username with sufficient access rights.

   6. *Password -* The corresponding password for the PostgreSQL username.

   7. *Communication Channel -* Ensure the communication channel (Cloud or OPA) is accessible for remote connection, depending on your preferred method.

   8. *Save Settings -* Click on the Save button located at the bottom of the form.

## Actions

Specific tasks you want to perform in your PostgreSQL database through Engini. These actions can automate data management, such as inserting records, running queries, or interacting with specific tables and databases in PostgreSQL.

### Create Record

This activity allows you to create a new record in a specified PostgreSQL table.

<img src="https://mintcdn.com/engini/ulV3eE0C34-TYWrM/help/assets/apps/postgres-sql/vPRj5TfaKChKru3ykFUPR_2-15.png?fit=max&auto=format&n=ulV3eE0C34-TYWrM&q=85&s=64524cf7850b961193277eefd3a3de24" alt="" width="1917" height="907" data-path="help/assets/apps/postgres-sql/vPRj5TfaKChKru3ykFUPR_2-15.png" />

1. *Table* - Choose the table where the new record will be inserted. Make sure to select the correct table from your PostgreSQL database.
2. *Add Field* - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, [click here](/help/workflows/workflow-editor#add-fields).

### Get Records

This activity retrieves records from a specified PostgreSQL table or view. You can set limits, sorting, and filters to refine the results.

<img src="https://mintcdn.com/engini/ulV3eE0C34-TYWrM/help/assets/apps/postgres-sql/wiQ6vgZJO9ARxyUGRWoHi_1-8.png?fit=max&auto=format&n=ulV3eE0C34-TYWrM&q=85&s=59e1cb35f3e107aaa2bff86a72ffc29c" alt="" width="1917" height="905" data-path="help/assets/apps/postgres-sql/wiQ6vgZJO9ARxyUGRWoHi_1-8.png" />

1. *Table/View* - Specify the name of the table or view from which you want to retrieve records. Ensure the correct PostgreSQL table or view is selected.
2. *Top* - Define the maximum number of rows to retrieve. The default is 100 if no value is provided.
3. *Offset* - Specify the number of rows to skip before starting the retrieval. This is useful for pagination. The default is 0 (no rows skipped).
4. *Add Filter -* Click Add Filter to define conditions that narrow down the data list and return only the relevant items. To learn more about using filters, [click here](/help/workflows/workflow-editor#add-filters).
5. *Add Sort -* Click Add Sort to organize the data list by a selected field in ascending or descending order. To learn more about sorting data, [click here](/help/workflows/workflow-editor#add-sorts).

### Update Record

This activity allows you to update an existing record in a specified PostgreSQL table.

<img src="https://mintcdn.com/engini/_MSo-hm6zXTakHQg/help/assets/apps/postgres-sql/IWtTX5d5sJD2HOu_eXqz5_2-16.png?fit=max&auto=format&n=_MSo-hm6zXTakHQg&q=85&s=bd32a943c273df347c5fb5136e650f88" alt="" width="1916" height="905" data-path="help/assets/apps/postgres-sql/IWtTX5d5sJD2HOu_eXqz5_2-16.png" />

1. *Table* - Specify the name of the table where the record you want to update is located. Ensure the correct PostgreSQL table is selected.
2. *Add Field* - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, [click here](/help/workflows/workflow-editor#add-fields).

### Update Records

This activity allows you to update multiple records in a specified PostgreSQL table based on a filter. You can specify the table, and add filtering conditions.

<img src="https://mintcdn.com/engini/ulV3eE0C34-TYWrM/help/assets/apps/postgres-sql/l50cT9SCnkyu4glmf_1zz_1-9.png?fit=max&auto=format&n=ulV3eE0C34-TYWrM&q=85&s=ca1788883912aa563e3eb35cac9e66bc" alt="" width="1916" height="901" data-path="help/assets/apps/postgres-sql/l50cT9SCnkyu4glmf_1zz_1-9.png" />

1. *Table* - Enter the name of the table where the records you want to update are located. Ensure the correct PostgreSQL table is selected.
2. *Add Filter -* Click Add Filter to define conditions that narrow down the data list and return only the relevant items. To learn more about using filters, [click here](/help/workflows/workflow-editor#add-filters).
3. *Add Field* - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, [click here](/help/workflows/workflow-editor#add-fields).

### Delete Records

This activity allows you to delete records from a specified PostgreSQL table based on a defined filter.

<img src="https://mintcdn.com/engini/_MSo-hm6zXTakHQg/help/assets/apps/postgres-sql/Q7VRa3_Czb0Xz0Oq3kEoR_2-18.png?fit=max&auto=format&n=_MSo-hm6zXTakHQg&q=85&s=fbfea3bff427f1e228e985f0db9cc70d" alt="" width="1916" height="905" data-path="help/assets/apps/postgres-sql/Q7VRa3_Czb0Xz0Oq3kEoR_2-18.png" />

1. *Table* - Specify the table from which records will be deleted. Make sure to select the correct table from your PostgreSQL database.
2. *Add Filter -* Click Add Filter to define conditions that narrow down the data list and return only the relevant items. To learn more about using filters, [click here](/help/workflows/workflow-editor#add-filters).

### Create Batch of Records

This activity allows you to insert a batch of records into a specified PostgreSQL table.

<img src="https://mintcdn.com/engini/ulV3eE0C34-TYWrM/help/assets/apps/postgres-sql/pt9YkAeXNPGV-PdtOpHdA_1-10.png?fit=max&auto=format&n=ulV3eE0C34-TYWrM&q=85&s=ca2c90605ba953baae0711e216807a71" alt="" width="1915" height="903" data-path="help/assets/apps/postgres-sql/pt9YkAeXNPGV-PdtOpHdA_1-10.png" />

1. *Data List* - Specifies the list of records you want to insert. The batch can handle up to 1000 items.
2. *Table* - The name of the table where the records will be inserted. Ensure the correct table from your PostgreSQL database is selected.
3. *Add Field* - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, [click here](/help/workflows/workflow-editor#add-fields).

### Get Records Batch

This activity retrieves a batch of records from a specified PostgreSQL table. You can define the batch size, set sorting and filtering options.

<img src="https://mintcdn.com/engini/_MSo-hm6zXTakHQg/help/assets/apps/postgres-sql/Ebjg5z8SCuYt8wTLuP6Ib_3-3.png?fit=max&auto=format&n=_MSo-hm6zXTakHQg&q=85&s=676850947a222d8c07f331bb92c0c2a7" alt="" width="1913" height="903" data-path="help/assets/apps/postgres-sql/Ebjg5z8SCuYt8wTLuP6Ib_3-3.png" />

1. *Data List* - Specifies the list of records to retrieve in a batch. The maximum batch size is 1000 items.
2. *Table* - Enter the name of the table from which you want to retrieve the batch of records. Ensure the correct PostgreSQL table is selected.
3. *Top* N - Define the maximum number of rows to retrieve. The default value is 100.
4. *Add Filter -* Click Add Filter to define conditions that narrow down the data list and return only the relevant items. To learn more about using filters, [click here](/help/workflows/workflow-editor#add-filters).
5. *Add Sort -* Click Add Sort to organize the data list by a selected field in ascending or descending order. To learn more about sorting data, [click here](/help/workflows/workflow-editor#add-sorts).

### Update Batch of Records

This activity allows you to update a batch of records in a specified PostgreSQL table. You can provide the list of data to update, and set filtering conditions.

<img src="https://mintcdn.com/engini/_MSo-hm6zXTakHQg/help/assets/apps/postgres-sql/CwwEqYFtz2tPodgbacx3j_2-19.png?fit=max&auto=format&n=_MSo-hm6zXTakHQg&q=85&s=fb0ea1a1bdfa517be5f77d4093952ef7" alt="" width="1914" height="905" data-path="help/assets/apps/postgres-sql/CwwEqYFtz2tPodgbacx3j_2-19.png" />

1. *Data List* - Specifies the list of records to be updated. The maximum batch size is 1000 items.
2. *Table* - Enter the name of the table where the batch of records will be updated. Ensure the correct PostgreSQL table is selected.
3. *Add Filter -* Click Add Filter to define conditions that narrow down the data list and return only the relevant items. To learn more about using filters, [click here](/help/workflows/workflow-editor#add-filters).
4. *Add Field* - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, [click here](/help/workflows/workflow-editor#add-fields).

### Execute Customized SQL

This activity allows you to run a custom SQL query directly on a PostgreSQL database. You can write any SQL command, such as SELECT, INSERT, UPDATE, or DELETE, and execute it against the database.

<img src="https://mintcdn.com/engini/_MSo-hm6zXTakHQg/help/assets/apps/postgres-sql/1KiHrKhNPCzGKdbA_rUrg_image.png?fit=max&auto=format&n=_MSo-hm6zXTakHQg&q=85&s=5f894a4207517aef156b927ad70eb116" alt="" width="1916" height="906" data-path="help/assets/apps/postgres-sql/1KiHrKhNPCzGKdbA_rUrg_image.png" />

*SQL* - Enter the custom SQL query you want to execute. Ensure the query is correctly formatted for PostgreSQL and targets the correct database objects (e.g., tables, views).

### Execute Procedure

This activity allows you to execute a stored procedure in a PostgreSQL database. A stored procedure is a set of SQL statements that can perform a specific task, such as data manipulation or complex operations, in one call.

<img src="https://mintcdn.com/engini/_MSo-hm6zXTakHQg/help/assets/apps/postgres-sql/ZEP7vK2-QQEwORMF2dF13_2-20.png?fit=max&auto=format&n=_MSo-hm6zXTakHQg&q=85&s=c5a15d20fa0df47fb1f8f20ee4ab055e" alt="" width="1913" height="904" data-path="help/assets/apps/postgres-sql/ZEP7vK2-QQEwORMF2dF13_2-20.png" />

1. *Procedure Name* - Enter the name of the stored procedure you want to execute. Ensure that the procedure exists in the PostgreSQL database and that it has the required parameters (if any).
2. *Add Field* - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, [click here](/help/workflows/workflow-editor#add-fields).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.