Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>mc-pg-utilsNew to Visual Studio Code? Get it now.
mc-pg-utils

mc-pg-utils

mohanchinnappan

|
2 installs
| (0) | Free
Connect, Query, and Visualize PostgreSQL databases directly in VS Code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

🐘 PostgreSQL Tools for Visual Studio Code

PostgreSQL Tools is a VS Code extension that simplifies PostgreSQL database management with an intuitive and powerful interface — connect, explore, query, and visualize your data right inside VS Code.


Screenshots

  • demo1

  • demo2

  • demo3

✨ Features

  • 🗂️ Database Explorer — Browse databases and tables in a tree view within the VS Code sidebar.
  • 🔍 Table Data View — Display table data with search, sorting, and pagination.
  • 💻 SQL Query Editor — Run custom SQL queries and view results in a tabulated format.
  • 📊 Data Visualization — Create bar, line, pie, doughnut, and scatter charts with flexible axes and aggregations.
  • 📁 Export Options — Export table data or query results to CSV, and download charts as PNG.
  • 🔐 Connection Management — Easily connect to PostgreSQL databases with configurable host, port, username, password, and database name.

⚙️ Installation

1️⃣ Install the Extension

  1. Open Visual Studio Code
  2. Go to the Extensions View → Ctrl+Shift+X (or Cmd+Shift+X on macOS)
  3. Search for “PostgreSQL Tools”
  4. Click Install

2️⃣ Prerequisites

  • 🧱 A running PostgreSQL server
  • 🟩 Node.js (included in VS Code runtime)
  • 📦 The extension bundles the pg library (v8.11.0 or higher)

🚀 Usage Guide

🔗 1. Connecting to a Database

  • Open the PostgreSQL Tools view in the sidebar (look for the 🐘 icon)
  • Click “Connect to PostgreSQL Database”
  • Enter connection details:
    • Host: e.g. localhost
    • Port: default 5432
    • Username: e.g. postgres
    • Password: your database password
    • Database Name: optional

✅ On successful connection, the explorer will display your available databases.


🗂️ 2. Exploring Databases and Tables

  • Expand a database to see its tables.
  • Click on a table to open its Data View in a new panel.
  • Interactively search, sort, and paginate through your data.

🔍 3. Viewing Table Data

Inside the Data View tab:

  • Search: Filter rows by keyword or column
  • Sort: Click on column headers
  • Paginate: Choose page size (25, 50, 100)
  • Export: Click “Export CSV” to save results

💻 4. Running SQL Queries

In the Query Editor tab:

  1. Enter your SQL query (e.g. SELECT * FROM employees LIMIT 100)
  2. Click Run Query ▶️
  3. View results in a grid
  4. Export CSV or Clear the editor anytime

📊 5. Visualizing Data

In the Visualization tab:

  • Choose Chart Type: Bar, Line, Pie, Doughnut, or Scatter
  • Select X-Axis and Y-Axis fields
  • Pick an Aggregation (Sum, Count, Avg, Min, Max)
  • Add an optional Chart Title
  • Click Generate Chart to render
  • 🖼️ Download PNG for your chart

🔌 6. Disconnecting

Click “Disconnect from Database” to safely close your session.


🧭 Commands

Access these via the Command Palette (Ctrl+Shift+P / Cmd+Shift+P):

Command Description
PostgreSQL: Connect to Database Connect to a PostgreSQL server
PostgreSQL: Disconnect from Database End the active session
PostgreSQL: Refresh Explorer Refresh database and table list
PostgreSQL: View Table Data Open data view for a selected table
PostgreSQL: Open Query Editor Open the SQL editor
PostgreSQL: Visualize Data Switch to chart visualization tab

🧾 Requirements

  • 🧩 VS Code v1.60.0 or higher
  • 🐘 PostgreSQL server accessible over the network
  • No extra extensions required

⚠️ Known Issues

  • � Saved connection configurations (pg-tools.connections) not persistent yet
  • �🐢 Large datasets (>1000 rows) may impact performance

📜 License

This extension is licensed under the MIT License.
See the LICENSE file for details.


🧠 Tip

Combine PostgreSQL Tools with VS Code’s built-in terminal for the ultimate SQL + code workflow 🚀


Made with ❤️ by Mohan Chinnappan

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft