libpg_query
« Back to VersTracker
Description:
C library for accessing the PostgreSQL parser outside of the server environment
Type: Formula  |  Latest Version: 17-6.2.2@0  |  Tracked Since: Dec 15, 2025
Links: Homepage  |  formulae.brew.sh
Category: Developer tools
Tags: postgresql sql parser library c-library
Install: brew install libpg_query
About:
libpg_query is a C library that extracts the PostgreSQL query parser into a standalone component. It allows developers to parse SQL queries into parse trees without needing a running database server. This enables powerful static analysis, linting, and rewriting of SQL queries within external applications.
Key Features:
  • Standalone PostgreSQL parser extracted from server code
  • No database connection required for parsing
  • Outputs detailed parse trees and raw parse trees
  • Supports multiple PostgreSQL versions
Use Cases:
  • SQL linters and formatters
  • Static analysis tools for query optimization
  • SQL query rewriting and migration tools
  • Database schema visualization
Alternatives:
  • sqlparse – Python-based tokenizer/parser that is less strict and doesn't use the actual PostgreSQL parser
  • libpq – PostgreSQL client library that requires a server connection; libpg_query works offline
Version History
Detected Version Rev Change Commit
Jan 27, 2026 8:08am 17-6.2.2 0 VERSION_BUMP fa6bd014
Jan 21, 2026 2:53am 17-6.2.1 0 VERSION_BUMP 7a386883
Dec 15, 2025 10:15pm 17-6.2.0 0 VERSION_BUMP 55c210ee