← Back to Postgres GUI FAQs

How to Run SQL Queries in Postgres GUI

Once connected to your PostgreSQL database, you can run any SQL statement using the built-in query editor.

Running a Query

  1. Type your SQL in the query editor panel on the right side of the screen.
  2. Click the Run button to execute.
  3. Results appear in the Results tab at the bottom, along with the execution time.

Quick Table Inspection

Instead of writing SQL manually, you can click any table name in the Tables tab. This automatically runs SELECT * FROM tablename LIMIT 200 and shows the results.

Query History

Every query you execute is saved to the History tab (up to 20 entries). Click any past query to re-run it. History is stored in your browser's IndexedDB and persists across sessions.

Example Queries

SELECT current_database(), current_user, version();
SELECT tablename FROM pg_tables WHERE schemaname = 'public';
SELECT column_name, data_type FROM information_schema.columns WHERE table_name = 'your_table';
SELECT pg_size_pretty(pg_database_size(current_database()));

Tips

  • Always add LIMIT when exploring large tables
  • Use the execution time to identify slow queries
  • Errors are displayed with the full PostgreSQL error message for easy debugging
  • You can run any SQL — SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, etc.