PostgreSQL

Use PostgreSQL to query and modify rows, execute SQL, and inspect tables, columns, keys, and indexes. Schema inspection lets a workflow discover the database structure before generating a query.

Usage Instructions

Integrate PostgreSQL into the workflow. Can query, insert, update, delete, and execute raw SQL.

Actions

PostgreSQL Query

Execute a SELECT query on PostgreSQL database

Input

ParameterTypeRequiredDescription
hoststringYesPostgreSQL server hostname or IP address
portnumberYesPostgreSQL server port (default: 5432)
databasestringYesDatabase name to connect to
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)
querystringYesSQL SELECT query to execute

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayArray of rows returned from the query
rowCountnumberNumber of rows returned

PostgreSQL Insert

Insert data into PostgreSQL database

Input

ParameterTypeRequiredDescription
hoststringYesPostgreSQL server hostname or IP address
portnumberYesPostgreSQL server port (default: 5432)
databasestringYesDatabase name to connect to
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)
tablestringYesTable name to insert data into
dataobjectYesData object to insert (key-value pairs)

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayInserted data (if RETURNING clause used)
rowCountnumberNumber of rows inserted

PostgreSQL Update

Update data in PostgreSQL database

Input

ParameterTypeRequiredDescription
hoststringYesPostgreSQL server hostname or IP address
portnumberYesPostgreSQL server port (default: 5432)
databasestringYesDatabase name to connect to
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)
tablestringYesTable name to update data in
dataobjectYesData object with fields to update (key-value pairs)
wherestringYesWHERE clause condition (without WHERE keyword)

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayUpdated data (if RETURNING clause used)
rowCountnumberNumber of rows updated

PostgreSQL Delete

Delete data from PostgreSQL database

Input

ParameterTypeRequiredDescription
hoststringYesPostgreSQL server hostname or IP address
portnumberYesPostgreSQL server port (default: 5432)
databasestringYesDatabase name to connect to
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)
tablestringYesTable name to delete data from
wherestringYesWHERE clause condition (without WHERE keyword)

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayDeleted data (if RETURNING clause used)
rowCountnumberNumber of rows deleted

PostgreSQL Execute

Execute raw SQL query on PostgreSQL database

Input

ParameterTypeRequiredDescription
hoststringYesPostgreSQL server hostname or IP address
portnumberYesPostgreSQL server port (default: 5432)
databasestringYesDatabase name to connect to
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)
querystringYesRaw SQL query to execute

Output

ParameterTypeDescription
messagestringOperation status message
rowsarrayArray of rows returned from the query
rowCountnumberNumber of rows affected

PostgreSQL Introspect

Introspect PostgreSQL database schema to retrieve table structures, columns, and relationships

Input

ParameterTypeRequiredDescription
hoststringYesPostgreSQL server hostname or IP address
portnumberYesPostgreSQL server port (default: 5432)
databasestringYesDatabase name to connect to
usernamestringYesDatabase username
passwordstringYesDatabase password
sslstringNoSSL connection mode (disabled, required, preferred)
schemastringNoSchema to introspect (default: public)

Output

ParameterTypeDescription
messagestringOperation status message
tablesarrayArray of table schemas with columns, keys, and indexes
↳ namestringTable name
↳ schemastringSchema name (e.g., public)
↳ columnsarrayTable columns
↳ namestringColumn name
↳ typestringData type (e.g., integer, varchar, timestamp)
↳ nullablebooleanWhether the column allows NULL values
↳ defaultstringDefault value expression
↳ isPrimaryKeybooleanWhether the column is part of the primary key
↳ isForeignKeybooleanWhether the column is a foreign key
↳ referencesobjectForeign key reference information
↳ tablestringReferenced table name
↳ columnstringReferenced column name
↳ primaryKeyarrayPrimary key column names
↳ foreignKeysarrayForeign key constraints
↳ columnstringLocal column name
↳ referencesTablestringReferenced table name
↳ referencesColumnstringReferenced column name
↳ indexesarrayTable indexes
↳ namestringIndex name
↳ columnsarrayColumns included in the index
↳ uniquebooleanWhether the index enforces uniqueness
schemasarrayList of available schemas in the database