PostgreSQL connector for ChatGPT

Use Porter’s PostgreSQL connector for ChatGPT to ask about the tables you choose through a read-only role, then compare them with Google Ads spend.

  • Count orders or signups by day and status
  • Rank lead sources by leads and won leads
  • Flag days that look off against the 7-day average
  • Compare signups with Google Ads spend for cost per signup
G2★★★★★Rated 4.6/5 on G2 (288 reviews, October 2026)

By Porter Metrics team · Last updated October 20, 2026

ChatGPTPorter connected
Using my table public.orders, count rows by day for the last 14 days using the created_at column.
Porter / PostgreSQL / Trailgear Demo✓ 4 rows
Oct 10 had the most new orders (1,284). Weekdays average about 1,050.
DayRows
Oct 71,012
Oct 81,047
Oct 91,096
Oct 101,284
Demo data, Trailgear Demo account
One table per question
01Setup

How to connect PostgreSQL to ChatGPT

Porter’s PostgreSQL connector for ChatGPT takes 3 steps, and you don’t install an MCP server anywhere. Create a read-only role and enter its credentials in Porter. Add Porter’s MCP URL to ChatGPT as a custom MCP server, then ask about any table that role reads. MCP (Model Context Protocol) is the open standard ChatGPT uses to connect to tools.

What you need first

  • Before you start, you need a PostgreSQL database that accepts connections from outside its network, and a role you can grant privileges to. You also need a free Porter account and a ChatGPT plan that supports custom MCP servers.
  • Custom MCP servers are in beta in ChatGPT on the web, so set up Porter and ask your questions from a browser. On Business, Enterprise or Edu, an admin or owner turns on developer mode; on Pro, you turn on developer mode yourself (OpenAI’s guide to custom MCP apps).
  • Works in ChatGPT on the web (chatgpt.com, custom MCP servers in beta) and in Codex, with the same Porter MCP URL.
  1. Step 1: Create a read-only role and connect it in Porter

    Run the SQL under “What the connector needs from PostgreSQL” to create a read-only role. Then sign up free at Porter, pick PostgreSQL as the source and enter that role’s credentials. Finally, pick ChatGPT as the destination.

  2. Step 2: Add the connector to ChatGPT

    In ChatGPT, open Customize › Plugins, click Add and choose Add custom MCP server. On Business, an admin does this from Workspace settings › Apps › Create. Name it Porter Metrics, paste the URL of Porter’s MCP server as the Server URL and keep OAuth as the authentication:

    MCP URL
    https://mcp.portermetrics.com/mcp

    Tick “I understand and want to continue”, then select Create as a plugin.

  3. Step 3: Ask ChatGPT about PostgreSQL

    Next, select Continue to Porter Metrics, sign in to Porter and click Allow Access. Then select Try in chat and paste this prompt:

    Prompt
    Using my PostgreSQL table public.orders, count rows by day for the last 14 days using the created_at column.

Guides and videos

Connect PostgreSQL to ChatGPT free

app.portermetrics.com / create

Create: PostgreSQL to ChatGPT

Sign in: PostgreSQL

Select the accounts ChatGPT can use.

ChatGPT / Customize / Plugins / Add / Add custom MCP server

Remote MCP server URL

https://mcp.portermetrics.com/mcp

ChatGPT

Using Porter / PostgreSQL …

Demo data
02Use cases and prompts

What you can ask ChatGPT

Each use case comes with a prompt to copy, the columns it needs and who it’s for. Column names are examples, so swap in your own table and columns, and name the date column so ChatGPT filters on the right one.

Can ChatGPT count the orders or signups that came in each day?

The problemWhen the e-commerce manager asks how many orders failed yesterday, getting the answer means opening psql or pinging the backend team.

What ChatGPT doesChatGPT reads the table, then counts rows by day and status or sums an amount column.

What you getThe daily count lands in your chat instead of a ticket for whoever has database access.

Prompt
From my PostgreSQL table public.orders, count rows and sum amount by day and status for the last 30 days, using created_at as the date. Which status changed most?

For: marketing ops · founders · growth marketers

Fields used: your table's columns, for example a date column (created_at), a category column (status) and a numeric column

Can ChatGPT show which lead source brings the most leads?

The problemYour signup form writes a source into every lead row, but grouping that column still takes a query nobody in marketing can write.

What ChatGPT doesChatGPT groups a leads table by its source column, then ranks sources for last week and last month. It also adds won leads when the table has a status column.

What you getSo you can decide which source gets next week’s budget without waiting on someone’s saved query.

Prompt
From my PostgreSQL table crm.leads, count leads by source for last week and last month using created_at, plus leads where status is won. Rank sources by won leads.

For: growth marketers · CRM managers · agencies

Fields used: your table's columns, for example source, status, created_at

Can ChatGPT flag days that look off?

The problemA bad deploy quietly stops orders from being written, and nobody notices until the weekly report comes out wrong.

What ChatGPT doesChatGPT reads 60 days of daily totals from the table, then flags days far from the trailing 7-day average.

What you getSo a drop shows up the day you ask, not in next week’s report.

Prompt
From my PostgreSQL table public.orders, show daily row count and sum of amount for the last 60 days using created_at. Flag days more than 30% away from the trailing 7-day average.

For: founders · marketing analysts · e-commerce managers

Fields used: your table's columns, for example created_at, amount

Can ChatGPT combine two tables, like orders and customers?

The problemOrders by customer plan needs a join, but that join lives in one engineer’s saved SQL file.

What ChatGPT doesChatGPT queries each table separately and then matches the results in chat on a shared column. Each table counts as one Porter account.

What you getAs a result, you get order totals by plan without a new view or a request to the backend team.

Prompt
From my PostgreSQL tables public.orders and public.customers, get last month's order count and amount by customer_id, then each customer's plan. Match them on customer_id and total orders by plan.

For: marketing ops · analysts · founders

Fields used: orders table: customer_id, created_at, amountcustomers table: customer_id, plan

Can ChatGPT tell if more Google Ads spend brought more signups?

The problemGoogle Ads counts conversions from its own tag, while the product team only believes the users table, so the two numbers never agree.

What ChatGPT doesWith Google Ads also connected in Porter, ChatGPT puts daily Google Ads Cost next to the daily row count of your signups table. Then it works out cost per signup by week. You see how spend and signups move together, week by week.

What you getThe weekly budget call can then rest on the signup count the product team trusts, set against what paid search cost.

Prompt
For the last 8 weeks, show Google Ads Cost by week next to the weekly count of rows in my PostgreSQL table public.users using created_at. Work out cost per signup and say whether higher-spend weeks brought more signups.

For: growth and performance marketers · agencies

Fields used: your signups table's date columnCost
03Why Porter

Why Porter for PostgreSQL in ChatGPT

The PostgreSQL project publishes no official MCP, so Porter brings the tables your role can read into ChatGPT, next to your ad, CRM and analytics data. Need to write SQL or change rows instead? Use a provider MCP such as Supabase’s MCP server or Neon’s MCP server, which run any SQL you allow.

✓

One URL, nothing to host

Porter hosts the MCP server, so there’s nothing to install or patch. Create a read-only role, enter its credentials in Porter and add one MCP URL to ChatGPT on the web.

⊞

Safe for production data

ChatGPT reads every table your role can SELECT and tells you what changed, while your rows stay exactly as you set them. Your grants decide which tables ChatGPT sees.

⚙

Your app data next to your ads

Ask about orders or signups next to Google Ads, Meta Ads, GA4, HubSpot and other Porter connectors, for cost per signup from the table your product team trusts.

Aa

Works with any host

Porter reaches any PostgreSQL that accepts its connection, including Supabase, Neon, Amazon RDS and Cloud SQL. It signs in with database credentials, not a provider login.

↻

Free plan to start

The PostgreSQL connector comes with every Porter plan, including Free, so your first table costs nothing to try.

✓

Live dashboards, not only chat answers

Ask ChatGPT for a dashboard and Porter’s AI dashboards publish it at its own link, synced automatically and ready to share. Official MCP servers answer inside the chat and stop there.

04Dashboard

Dashboard template

Start from a ready-made PostgreSQL template, or ask ChatGPT to build a live one with AI dashboards.

AI dashboards

Build a live PostgreSQL dashboard from the chat

Describe the dashboard in one sentence and Porter builds it. A client-ready dashboard in minutes, with no chart dragging and no BI tool to learn. Ask ChatGPT:

Prompt
Build a live PostgreSQL dashboard for my account with the last 30 days, the main KPIs and a weekly trend.
Live URLEach dashboard at its own link: no login, no app, no download
Auto-syncFresh PostgreSQL data, nobody re-exports each period
Scheduled deliveryEmail or PDF sends on a set day
White labelYour logo and branding for clients
Sharing permissionsView or edit access per person

Or start from a template

05Pricing

Pricing

You can start free, since Porter’s PostgreSQL connector for ChatGPT comes with every plan. Use the calculator for your number of accounts, or see Porter pricing for every plan.

What you get

  • Free plan: never expires, with unlimited connected accounts and the last 15 days of data in ChatGPT (30 days in Data Studio and Sheets)
  • Reporting: from $12.50 per account a month billed annually, or $15 month to month for one account
  • Billing: every PostgreSQL table you query counts as one account, with volume discounts and no per-seat fee
  • No credits needed: ChatGPT’s PostgreSQL questions are reads, so they use no AI credits
  • Trial: 14 days of full access, no card

Price calculator

$33.33/mo$6.67 per account

An account is one ad account, Stripe account, store, page or GA4 property. The Free plan never expires and has unlimited accounts, with the last 15 days of data in AI chats.

06Data and actions

PostgreSQL data ChatGPT can use

The PostgreSQL connector gives ChatGPT no fixed field list. Instead, each table your role can read shows up as its own account, named schema.table. Its columns then become the fields ChatGPT filters, groups and adds up. ChatGPT reads one table per question and matches results across tables in chat.

How ChatGPT reads PostgreSQL

What Porter readsExampleNote
Tablespublic.orders, analytics.signupsOne account each
Columnscreated_at, status, amountOnly columns the role can read
System columnsctidNever listed

Product stats

WhatPostgreSQL connector
FieldsNo fixed list; each column the role can read is a field
ActionsReads only, so your database stays exactly as you set it
ReadsOne table per question, named schema.table, from every schema the role can read
History30 days on the Free plan, 15 in AI chats
AccessRead-only role with CONNECT, USAGE and SELECT
Not readSystem columns such as ctid, and tables the role can't SELECT
DatabasesAny PostgreSQL that accepts outside connections, including Supabase, Neon, Amazon RDS and Cloud SQL
07Security

Is it safe?

Yes. Porter reads through a role that holds only SELECT, so your rows and tables stay exactly as you set them, and PostgreSQL itself enforces that. If you can, point the connection at a read replica to keep long reporting questions off the primary.

What the connector needs from PostgreSQL

Porter needs CONNECT on the database, USAGE on each schema and SELECT on each table (PostgreSQL's GRANT reference). For tables created after setup, the role that creates them runs ALTER DEFAULT PRIVILEGES (PostgreSQL's ALTER DEFAULT PRIVILEGES docs).

SQL
CREATE ROLE porter_ro LOGIN PASSWORD 'choose-a-strong-password'; GRANT CONNECT ON DATABASE mydb TO porter_ro; GRANT USAGE ON SCHEMA public TO porter_ro; GRANT SELECT ON ALL TABLES IN SCHEMA public TO porter_ro; ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO porter_ro;

Network and encryption

PostgreSQL only accepts remote connections once listen_addresses goes beyond localhost, and pg_hba.conf must allow the connection, ideally with scram-sha-256 passwords (PostgreSQL's pg_hba.conf rules). In addition, the strictest SSL mode, verify-full, checks both the server certificate and its host name (libpq's SSL modes).

Use a read replica

A replica takes reporting load off the primary, especially for long questions. On a hot standby, though, PostgreSQL cancels a query that blocks replay once max_standby_streaming_delay passes, 30 seconds by default (PostgreSQL's standby server settings).

08FAQ

FAQ

The questions fall into two groups. Three are about fit: hosted databases, whether MCP works with databases at all, and tables across several schemas. Then three are fixes: numbers that don't match your SQL client, tables with no columns, and long questions that fail.

Does it work with Supabase, Neon, Amazon RDS or Cloud SQL?

Yes. Porter's PostgreSQL connector for ChatGPT reaches a hosted database as long as it accepts outside connections. Porter signs in with database credentials, not a provider login, so ChatGPT can read Supabase, Neon, Amazon RDS and Cloud SQL databases alike. Neon and Prisma Postgres also appear in Porter as separate integrations for actions.

Can MCP connect to a database?

Yes. In short, an MCP server such as Porter's sits between ChatGPT and the database and decides what ChatGPT can run. Porter's hosted server, for example, reads tables through a role you grant. However, provider servers from Supabase or Neon can run SQL, including writes, unless you switch on their read-only setting.

Can I connect tables from several schemas?

Yes. Porter lists tables from every schema your role can read under one connection, each named schema.table, and then ChatGPT asks about whichever table you name. Grant USAGE only on the schemas ChatGPT should see, because those are the only tables that show up.

Troubleshooting

Why don't the numbers match my SQL client?

ChatGPT's numbers through Porter usually differ from your SQL client because the two read a different table, filter, date column or time zone. So check those four first. A read replica can also trail the primary, so a count taken there may miss the newest rows.

Why does ChatGPT see no columns in my table?

Grant SELECT on the table and USAGE on its schema, then ask ChatGPT about the table again. PostgreSQL hides a table's columns from roles without a privilege on it, so an empty column list means the Porter role needs that grant.

Why does a long question fail?

Ask for a shorter date range. A long question can stop inside PostgreSQL before Porter returns any rows. The statement_timeout setting cancels statements past its limit (PostgreSQL's statement_timeout setting), and a hot standby can also cancel queries. Finally, the max_connections setting, typically 100, can refuse a new connection (PostgreSQL's connection settings).

09Next

More ChatGPT connectors

The MCP URL behind the PostgreSQL connector also gives ChatGPT every other source you connect in Porter. So your app tables can sit beside warehouse, CRM or analytics data in one chat. Browse all ChatGPT connectors or open a related page below:

Not only ChatGPT. Send PostgreSQL data anywhere

The same Porter account and connection also send PostgreSQL data to these destinations, at no extra cost.

Try the connector in ChatGPT

Setting up the PostgreSQL connector for ChatGPT takes one database role and one URL. Then ask which day dipped, which source converts and what a signup costs. The free plan already includes the MCP, so your first table costs nothing to try.

Written by the Porter Metrics team, who build Porter's connectors for ChatGPT and Claude.

Free plan · 14-day trial · No card needed

Growth marketers: cost per signup from the users table instead of an export.

Marketing ops: daily counts by status and source, straight from the database.

Founders: a same-day read on unusual days in orders or signups.