# PostgreSQL integration

> Connect to a PostgreSQL database to query, insert, update, and delete rows using SQL.

- Authentication: apiKey

## Tools (10)

- **Count Rows**: Count the number of rows in a table, optionally with filtering.
- **Custom Query**: Execute any arbitrary SQL statement including joins, aggregations, and complex queries.
- **Delete Row**: Delete one or more rows from a table and optionally return the deleted data.
- **Find Row**: Find a single row by a unique identifier or condition.
- **Insert Row**: Insert a new row into a table and return the inserted data.
- **List Columns**: Retrieve column definitions for a specific table using information_schema.
- **List Tables**: Retrieve all tables in the target schema using information_schema.
- **Select Rows**: Query rows from a table with filtering, sorting, and pagination.
- **Update Row**: Update one or more rows in a table and return the updated data.
- **Upsert Row**: Insert a row or update it if a conflict occurs on a unique constraint.

## Related prompts

- [SQL Crafter: draft, explain, and review queries from your schema](https://www.generalinput.com/prompts/sql-crafter-draft-explain-and-review-queries-from-your-schema.md)
- [Sharpen and ship any data analysis](https://www.generalinput.com/prompts/sharpen-and-ship-any-data-analysis.md)
- [Daily KPI snapshot from Postgres to Google Sheets](https://www.generalinput.com/prompts/daily-kpi-snapshot-from-postgres-to-google-sheets.md)
- [Triage Typeform product feedback into Postgres and Slack](https://www.generalinput.com/prompts/triage-typeform-product-feedback-into-postgres-and-slack.md)
- [Daily signup digest in Slack](https://www.generalinput.com/prompts/daily-signup-digest-in-slack.md)
- [Recover failed Stripe payments with Postgres context and Resend](https://www.generalinput.com/prompts/recover-failed-stripe-payments-with-postgres-context-and-resend.md)
- [Weekly at-risk customer outreach drafts for your CSM team](https://www.generalinput.com/prompts/weekly-at-risk-customer-outreach-drafts-for-your-csm-team.md)

Connect PostgreSQL in General Input: https://www.generalinput.com/apps/postgresql