Time to Go with PostgreSQL
summary
Adds a Go module into an existing C PostgreSQL extension (PGDeepThinker) to parse queries and emit advisory messages; uses cgo, a C-side parser (libpg_query / "lipq query") and gjson to turn parse trees into JSON and then extract patterns. Code shrinks from roughly 15 lines to 4 for many checks, making new pattern checks quick to add. Works in practice but increases binary size, requires C-shared/C-archive build and limits cross-language returns to simple strings or pointers.
AI-written summary · about
chapters (10)
- 0:00Introduction to talk
- 1:08Cybertech and PG extensions
- 3:35Poor SQL detection in PG Deep Thinker
- 7:50Motivation for using Go
- 10:19Setting up Go for PostgreSQL
- 12:05Exporting Go functions to C
- 14:59Compiling Go with PostgreSQL
- 16:28Benefits of Go integration
- 17:10Drawbacks and limitations
- 19:15Conclusion and Q&A
related talks
47mA Journey to Postgres Productivity with Go
32mA Journey to Postgres Productivity with Go
43mWhen it all GOes right
49mWhen it all GOes right
45mBuilding an Open Source MongoDB-compatible Database on Top of PostgreSQL
39mGophers riding Elephants
42mPostgreSQL Extensions: A Deep Dive
31mPostgres without SQL: Natural language queries using GPT-3 & Rust
