postgres@hacking:~$ grep -R '#psql' sessions/

#psql

5 related sessions.

· 94:41 · youtube ↗

Command-tag customization

Custom protocol command tags and _pq_ capability negotiation.

After testing the newly committed REPACK command and confirming that it is transactional but takes an access-exclusive lock, the group built a prototype for customizable command-completion tags such as schema-qualified table names. A first server-only change broke psql's parser, exposing the need for client/server capability negotiation. The agent then used the existing _pq_ protocol-options framework so only requesting clients receive the new format. They reviewed compatibility tests and concluded the patch was useful for discussion but needed cleanup before pgsql-hackers.

[timecodes · 8]
  1. Testing the new REPACK command
  2. REPACK locking and transaction behavior
  3. Designing descriptive command tags
  4. Prototype-first agentic implementation
  5. Server-only format change breaks psql
  6. Why protocol feature negotiation is required
  7. Using the _pq_ protocol-options framework
  8. Compatibility review and patch cleanup
active

direct mapping
· 86:12 · youtube ↗

URLs in psql \h output

Link psql help to online SQL-command documentation.

The group prototyped richer psql help after noting that autocomplete and backslash-h do little for functions or unknown keywords. They modified the no-match path to print clickable documentation or search URLs, added a configurable HELP_URLS variable containing pipe-separated templates, implemented substitution and URL encoding, and tested PostgreSQL.org, Google, and DuckDuckGo links. They kept PostgreSQL.org as the default, refined the wording, and prepared a discussion patch while leaving external API/LLM help and reusable URL functions as future ideas.

[timecodes · 8]
  1. Limits of SQL autocomplete and help
  2. A URL fallback for unknown help topics
  3. Finding psql's backslash-h output path
  4. First clickable PostgreSQL search link
  5. Implementing URL encoding
  6. Configurable HELP_URLS templates
  7. Supporting multiple pipe-separated URLs
  8. Final wording and patch preparation
exploration

correlated mapping
· 50:41 · youtube ↗

Configurable command tag, part 1

Explore custom command-completion tags returned to clients.

The session attempted to make PostgreSQL command-completion tags configurable, motivated by dump and restore output that says INSERT or COPY without identifying the relation. The proposed GUC would format tags with placeholders such as command name and relation names while preserving protocol compatibility. They threaded relation information through executor structures and reused a placeholder formatter, but the server repeatedly crashed because the helper was called incorrectly. The prototype remained unfinished, with lazy calculation of optional fields also identified as necessary.

[timecodes · 8]
  1. Updates on earlier patches and reviews
  2. Why command tags need relation context
  3. A configurable placeholder-based tag format
  4. Threading relation names through query completion
  5. Adding the command_tag_format GUC
  6. Formatting command and relation placeholders
  7. Server crashes and binary-search debugging
  8. Incorrect helper usage and unfinished prototype
active

correlated mapping
· 44:28 · youtube ↗

Postgres Hacking 101 with Andrey

Follow-up workshop likely reviewing the bounded psql \watch work.

After explaining CommitFest and release-cycle mechanics, the group designed extensible command-completion tags instead of changing PostgreSQL's long-stable protocol output directly. A format string could optionally include timestamps and affected relations, especially for readable dump and restore progress. They postponed implementation, then reviewed a libpq patch that randomizes a multi-host connection list. The Fisher-Yates shuffle appeared correct despite confusing code and minor whitespace issues, but they noted that randomization alone cannot avoid a slow replica and suggested future latency-aware selection.

[timecodes · 8]
  1. CommitFest cadence and the PostgreSQL release cycle
  2. What command-completion tags currently report
  3. Relation names and compatibility constraints
  4. Designing a configurable command-tag format
  5. Reviewing libpq multi-host load balancing
  6. Random ordering cannot avoid a slow replica
  7. Refactoring addresses out of PGconn
  8. Checking the Fisher-Yates shuffle implementation
committed

correlated mapping
· 56:56 · youtube ↗

Postgres Hacking 101: \watch with limited loops

Add a maximum iteration count to psql \watch.

The main exercise added a maximum iteration count to psql's backslash-watch command, allowing monitoring or sampling queries to stop automatically. Parsing a second optional argument exposed subtleties in psql's meta-command scanner, whitespace handling, defaults, and preserving unlimited behavior; the live prototype was close but still malfunctioned and needed offline cleanup before its later upstream completion. The final segment reviewed a proposed pg_stat_session view, questioning its per-backend memory and runtime overhead, missing functional tests, and practical value to DBAs.

[timecodes · 8]
  1. Use case for a bounded psql watch
  2. ULID work shifts toward UUIDv7
  3. Starting the psql meta-command patch
  4. Tracing watch argument parsing
  5. Adding the optional iteration argument
  6. Learning how multi-argument meta-commands parse
  7. Iteration defaults and preserving infinity
  8. Reviewing pg_stat_session counters and overhead
committed

direct mapping