Add research report on psql plugin system feasibility#17
Open
Add research report on psql plugin system feasibility#17
Conversation
…d historical analysis Comprehensive research into why PostgreSQL's psql client remains monolithic after 25+ years, covering: - Codebase analysis: hardcoded command dispatch (50+ if/else branches), zero hook points in main loop/query execution, no dynamic loading - Server contrast: 26+ hooks vs zero client hooks - pgsql-hackers history: no formal plugin proposal ever submitted - Case studies: \if took 17 files/2172 insertions; \crosstabview needed two commitfest cycles - Cultural factors: conservative process, "not the project" mindset - Strategic assessment for proposing upstream https://claude.ai/code/session_013B3EQeajCeqgoTKWLVMZkK
Added findings from deep mailing list search: - 2012 "Plugin For Console" thread (pgAdmin embedding, not psql extensibility) - 2017 psql variable hooks thread (internal only, Tom Lane/Verite/Frost) - Pipeline mode timeline: 4 years from libpq API to psql commands - \watch evolution across 5 major releases over 12 years - .psqlrc as the sole customization surface (2008 Momjian thread) - Key community members for psql patches (Lane, Coelho, Huinker, Verite, Stehule) - FOSDEM '21 talk on server extensibility resistance https://claude.ai/code/session_013B3EQeajCeqgoTKWLVMZkK
…alks Key additions from final research pass: - 2008 libpq Object Hooks (Merlin Moncure/Tom Lane): closest thing to a client-side extensibility proposal in PostgreSQL history. Lane called the hook-name approach "broken-by-design" - 2008 libpq pqtypes Hook API (Andrew Chernow): also not adopted - 2026 per-connection auth hooks (Karlsson/Champion): most recent client-side hook work, narrow scope - pspg as the de facto "plugin pattern" via PSQL_PAGER env var - MySQL client plugin system comparison (dlopen-based, PostgreSQL has no equivalent) - PGConf EU talks: Huinker 2017 "Getting By With Just psql", Frost 2018 "Hacking PostgreSQL" https://claude.ai/code/session_013B3EQeajCeqgoTKWLVMZkK
After 12+ targeted web searches: no formal RFC/patch/commitfest entry found, but the picture is more nuanced: - 2008 libpq hooks (Moncure) were the closest client-side proposal - Self-censorship is the likely explanation, not lack of interest - Community quotes: "getting stuff into forks/plugins is orders of magnitude easier than the kernel itself" - pgPedia documents a \set-based backslash alias workaround - Huinker's PGConf EU 2017 talk pushed psql's limits but stopped short of proposing a plugin system https://claude.ai/code/session_013B3EQeajCeqgoTKWLVMZkK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This adds a comprehensive research document analyzing why PostgreSQL's
psqlclient lacks a plugin/extension system despite the server having 26+ hook points, and what would be required to implement one.Key Changes
research/psql-plugin-system-research.md(362 lines)\if,\crosstabview,\watch)Notable Details
exec_command()incommand.cuses a 50+ branch if/else chain with no command registry or hook pointshttps://claude.ai/code/session_013B3EQeajCeqgoTKWLVMZkK