PostgreSQL Google Sheets
PostgreSQL
Query Streams
Ask Nova, get SQL + charts
Meet Nova Database REST APIOne key per partner. No credentials shared.
Build an API AutomationScheduled sync to 6+ platforms
Explore API to SQLQuery APIs with SQL, no code
Explore AI Database MCPClaude, Cursor, ChatGPT & Grok talk to your data
Connect AIQuery Streams enables you to connect PostgreSQL databases directly to Google Sheets, streaming live data without VPNs, firewall changes, or complex ODBC configuration. Sign up for free at QueryStreams.com and start pulling live Postgres data into your spreadsheets in minutes.
This guide shows you how to establish a secure, real-time connection between your PostgreSQL database and Google Sheets. Whether you’re running on-premise Postgres, AWS RDS for PostgreSQL, Azure Database for PostgreSQL, or Google Cloud SQL, Query Streams provides a simple solution for building live dashboards, automating reporting, and securely sharing database queries with teams worldwide.
Open Source Power
Connect to world’s most advanced open source database
Real-Time SQL
Execute PostgreSQL queries and get fresh data instantly
Global Access
Share queries worldwide without exposing credentials
Cloud & On-Premise
Works with AWS RDS, Azure, Google Cloud SQL
What You’ll Accomplish
By the end of this guide, you’ll be able to:
- Connect Google Sheets to PostgreSQL – On-premise, AWS RDS, Azure, or Google Cloud SQL
- Execute PostgreSQL queries in real-time from Google Sheets
- Build live dashboards and reports with auto-refreshing data
- Share secure database access with colleagues globally
Prerequisites
Query Streams Account
Create a free account to get started with PostgreSQL integration.
Create Free Account →Query Streams Agent Installed
Install the agent on your network with access to your PostgreSQL instance.
Install the Query Streams Agent →PostgreSQL Database Access
Database username and password with appropriate read permissions.
PostgreSQL User Guide →Step 1: Access the Query Streams Agent Interface
With your agent installed and running, configure your PostgreSQL connection through the local agent interface.
- Open your web browser and navigate to the agent interface:
https://localhost:1823 - Navigate to Data Connections: Click Data Sources in the sidebar, then select Connections
- Add a new connection: Click the Add Connection button
Step 2: Select PostgreSQL as Your Connection Type
- Choose PostgreSQL: Click on the PostgreSQL tile (it will highlight with a green border when selected)
- Alternative – Use search: Type “PostgreSQL” in the search bar to quickly find it
- Proceed to next step: Once selected, click Next
Step 3: Configure Your PostgreSQL Connection Details
You’re now on Step 2: Configure Connection where you’ll enter your PostgreSQL credentials.
Required Connection Details:
- Connection Name (required) – A friendly name like “Production PostgreSQL” or “AWS RDS Postgres”
- Server (required) – Hostname or IP address. Examples:
192.168.1.100,mydb.us-east-1.rds.amazonaws.com,localhost - Port (required) – Default is
5432. Change only if using a custom port. - Database (required) – Specific database name (e.g.,
myapp,analytics) - Username (required) – PostgreSQL database user
- Password (required) – Database password (click eye icon to toggle visibility)
- Connection Timeout – Default 30 seconds. Increase for slower networks.
Once all fields are completed, click Next to proceed.
Step 4: Select Your Data Realm
A Data Realm determines your query processing capacity – how much data can flow through your queries, measured in MB/GB based on your subscription.
- Review available realms: You’ll see options based on your subscription tier
- Select realm: Choose “Default Data Realm” for most use cases
- Click Next to test the connection
Step 5: Test Your Database Connection
Query Streams will verify your PostgreSQL is accessible with the credentials provided.
- Automatic testing: The agent attempts to connect to your PostgreSQL
- Review results: Success shows server version, database name, and connection details
- Click Next if successful
Step 6: Finish Setup
- Review configuration: Verify all settings are correct
- Click Finish to save your PostgreSQL connection
Your PostgreSQL connection is now ready! Next, you’ll install the Google Sheets add-on to start querying.
Step 7: Install Add-On and Run Your First Query
Install the Query Streams add-on from Google Workspace Marketplace:
After installation, open the add-on from Extensions > Query Streams and create your first PostgreSQL query:
- Click “Stream a Query” to begin creating a new query
- Select your PostgreSQL connection from the Data Source dropdown
- Choose the database from the Database dropdown
- Write your PostgreSQL query in the editor
SELECT
customer_id,
first_name,
last_name,
email,
country
FROM customers
WHERE country = 'USA'
ORDER BY last_name
LIMIT 100;
- Configure destination: Choose “Create a new tab” for your first query
- Click the Play button to execute the query
Success!
You’ve connected PostgreSQL to Google Sheets! Your data streams instantly into a new worksheet. Re-run anytime to refresh with the latest data from your database.
Next Steps: Save and Share Queries
Use the Query Streams web portal to build, save, and manage your PostgreSQL queries:
- Save queries: Store frequently used SQL for easy reuse
- Add parameters: Create dynamic filters users can adjust without seeing SQL
- Share globally: Let colleagues run queries from anywhere in the world
- Access from add-on: Saved queries appear in the “Saved Queries” menu
Frequently Asked Questions
❓ Does Query Streams use Google Apps Script? +
No. Query Streams uses the Google Sheets API directly for superior performance. Unlike Apps Script which has a 6-minute execution limit, Query Streams can handle large PostgreSQL datasets efficiently.
🔒 Is my PostgreSQL data secure? +
Yes. Database credentials never leave your network – they stay within the Query Streams agent. Data is encrypted in transit, and the agent only makes outbound connections (no firewall changes or VPNs required).
☁ Can I connect to AWS RDS for PostgreSQL? +
Yes. Query Streams works with AWS RDS for PostgreSQL, Azure Database for PostgreSQL, and Google Cloud SQL. Install the agent in the same cloud region for best performance.
👥 Can I share queries with external users? +
Yes! Share saved queries with external users who can run them from anywhere – they’ll get live data without ever seeing your SQL code or database credentials.
🚀 How does this compare to ODBC connections? +
Unlike ODBC, Query Streams requires no driver installation on user machines, no VPN configuration, and enables secure sharing where credentials stay protected. It works globally without network restrictions.

