Skip to content

refactor: rename to XXX; clarify log vs task queue#76

Closed
NikolayS wants to merge 5 commits intomainfrom
rename/logres
Closed

refactor: rename to XXX; clarify log vs task queue#76
NikolayS wants to merge 5 commits intomainfrom
rename/logres

Conversation

@NikolayS
Copy link
Copy Markdown
Owner

Why

From the HN thread on the prior PgQue release:

"Why insist on calling this a queue when it doesn't really have queue semantics? Queues do the job of load balancing between different workers. When workers acknowledge tasks, they get deleted, and there are visibility timeouts. This is a log."
adhocmobility on HN

The commenter is right. What ships is an append-only event log with per-consumer cursors and native fan-out — a Kafka topic shape, not an ActiveMQ / RabbitMQ / SQS task-queue shape. The old name was sending the wrong mental model at first read.

New name: logres. Short, no pg_ prefix (avoids extension confusion), zero collision with Postgres built-ins, evokes log directly.

(Supersedes #74, which proposed pg_current and got tangled with Postgres built-ins like pg_current_xact_id, pg_current_snapshot, pg_current_logfile, etc.)

Rename

Project identifier pgque / PgQuelogres everywhere (92 files, mechanical):

  • Schema: every pgque.* in SQL → logres.*.
  • Roles: pgque_reader / pgque_writer / pgque_adminlogres_reader / logres_writer / logres_admin.
  • Install file: sql/pgque.sqlsql/logres.sql (4770 lines rebuilt via build/transform.sh).
  • Source tree: sql/pgque-api/sql/logres-api/; sql/pgque-additions/sql/logres-additions/.
  • Tests: test_pgque_*test_logres_*; every pgque.* call renamed.
  • Build system: build/transform.sh now rewrites pgqlogres instead of pgqpgque.
  • Client libraries: clients/python/pgque/clients/python/logres/; clients/go/pgque.goclients/go/logres.go; package names, module paths, imports renamed across Python / Go / TypeScript.
  • CI: .github/workflows/ci.yml test DB name and credential env renamed.
  • Docs: every pgque / PgQue in README.md, docs/*.md, blueprints/*.md, CLAUDE.md, NOTICE renamed.

Preserved intentionally: pgq (parent project), pgqd (parent's daemon), PgQ (prose), pgq/ submodule, and the one build/transform.sh comment that names pgqueue as a boundary-case identifier to avoid mangling.

Client / schema compatibility: old pgque clients break against new logres schema and vice versa. Users upgrading need both sides.

README clarifications

H1 + tagline

  • H1 → "logres — event log for Postgres"
  • Tagline → "Zero-bloat event log, PgQ heritage. One SQL file to install, pg_cron to tick." (dropped the "queue" noun)

§Comparison subsection

"When to use logres vs. a job queue" replaced with "Log, not task queue (but can serve task-queue workloads)":

  • Good fit for log-as-task-queue: per-key ordered processing (partition by key), high-throughput uniform tasks, replayable pipelines, multi-consumer event streams, event-sourced systems where "task" and "event" collapse into one primitive.
  • Bad fit: high-variance task duration (head-of-line blocking), per-message retry with backoff and priority, SQS-style visibility timeouts, dynamic load balancing across heterogeneous workers.
  • For bad-fit: River / graphile-worker / Oban / pgmq / RabbitMQ / ActiveMQ / SQS.

The first-screen self-qualification line ("closer to Kafka (log) than to ActiveMQ or RabbitMQ (task message queue)") stays — that's the one-sentence version of the same distinction.

Out of scope

  • GitHub repo rename NikolayS/pgqueNikolayS/logres is owner action. Existing URLs redirect for 1 year after.
  • Schema-migration helper — pre-v0.1; clean reinstall acceptable. MIGRATION.md can land if/when a published pgque v0.1 exists in the wild.

Test plan

  • build/transform.sh assembles sql/logres.sql cleanly; all checks pass.
  • No pgque / PgQue strings remain (except the boundary-case comment in transform.sh).
  • CI on PG 14–18: test DB name logres_test + every logres.* call in every test.
  • Acceptance suite (tests/acceptance/) runs green.
  • Client smoke tests after their imports pick up renamed modules.

🤖 Generated with Claude Code

Nik Samokhvalov and others added 5 commits April 19, 2026 06:34
The "queue" framing in the previous name (PgQue) actively fought the
actual shape of the system. From the HN thread:

  "Why insist on calling this a queue when it doesn't really have
  queue semantics? Queues do the job of load balancing between
  different workers. When workers acknowledge tasks, they get deleted,
  and there are visibility timeouts. This is a log."

The commenter is right. What we ship is an append-only event log with
per-consumer cursors and native fan-out — a Kafka topic shape, not an
ActiveMQ / RabbitMQ / SQS task-queue shape. The old name sent the
wrong mental model at first read.

New name: logres. Short, has no pg_ prefix (no extension confusion),
no collision with Postgres built-ins, evokes "log" directly.

## Rename

Project identifier pgque / PgQue -> logres everywhere:

- Schema: every pgque.* in SQL -> logres.*
- Roles: pgque_reader / pgque_writer / pgque_admin ->
  logres_reader / logres_writer / logres_admin
- Install file: sql/pgque.sql -> sql/logres.sql (4770 lines rebuilt
  via build/transform.sh)
- Source tree: sql/pgque-api/ -> sql/logres-api/;
  sql/pgque-additions/ -> sql/logres-additions/
- Uninstall: sql/pgque_uninstall.sql -> sql/logres_uninstall.sql
- Tests: test_pgque_* renamed to test_logres_*; every pgque.* call
  in every test renamed
- Build system (build/transform.sh) now rewrites pgq -> logres
  instead of pgq -> pgque
- Client libraries: clients/python/pgque/ -> clients/python/logres/;
  clients/go/pgque.go -> clients/go/logres.go; package names, module
  paths, imports renamed across Python / Go / TypeScript
- CI (.github/workflows/ci.yml): test DB name and credential env
  renamed
- Docs: every pgque / PgQue in README.md, docs/*.md, blueprints/*.md,
  CLAUDE.md, NOTICE renamed

Preserved (intentionally not renamed): pgq (parent project), pgqd
(parent's daemon), PgQ (parent project in prose), pgq/ submodule
directory, and the one comment in build/transform.sh that names
"pgqueue" as a boundary-case identifier to avoid mangling.

Client libraries break against the old schema and vice versa —
users upgrading need to upgrade both.

## README clarifications

H1 + tagline refactored away from queue framing:

- H1: "logres — event log for Postgres"
- Tagline: "Zero-bloat event log, PgQ heritage. One SQL file to
  install, pg_cron to tick." (dropped the "queue" noun)

Comparison section's "When to use logres vs. a job queue"
subsection replaced with "Log, not task queue (but can serve
task-queue workloads)":

- Good-fit for log-as-task-queue: per-key ordered processing,
  high-throughput uniform tasks, replayable pipelines, multi-consumer
  event streams, event-sourced systems.
- Bad-fit: high-variance task duration (head-of-line blocking),
  per-message retry with backoff and priority, SQS-style visibility
  timeouts, dynamic load balancing across heterogeneous workers.
- For bad-fit: River / graphile-worker / Oban / pgmq / RabbitMQ /
  ActiveMQ / SQS.

The self-qualification line at the top (Kafka log vs ActiveMQ /
RabbitMQ task message queue) stays — it is the first-screen version
of the same distinction.

## Out of scope for this PR

- Repo rename on GitHub (NikolayS/pgque -> NikolayS/logres) —
  owner action. Once done, existing URLs redirect for 1 year.
- Schema-migration helper for existing pgque installs — pre-v0.1,
  clean reinstall is acceptable. Can add MIGRATION.md later if
  needed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
SPECx.md is the approved v1.1 specification from 2026-04-12 and
documents decisions made under the pgque / PgQue identifier. Rewriting
it to logres would erase that history and create confusion about what
was actually approved when.

Restore SPECx.md to the pre-rename content and prepend one blockquote
at the top noting the 2026-04-19 rename. Readers see the rename
immediately; the historical decisions stay verbatim; schema/role/class
names inside the doc read as pgque throughout with the banner telling
the reader to mentally translate to logres.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Functional review of #76 caught three classes of residual pgque
references that the perl pass 's/pgque/logres/g; s/PgQue/logres/g'
did not cover.

1. Capitalized class-name form `Pgque`. Survived in Python / Go /
   TypeScript client code (class names, type exports, docstrings)
   and in README client-library snippets that reference those
   classes. Replaced with `Logres` everywhere it appeared outside
   blueprints/SPECx.md.

2. All-caps env-var form `PGQUE`. Survived as `PGQUE_TEST_DSN` in
   the Python pytest conftest and the Go test file. Replaced with
   `LOGRES_TEST_DSN`.

3. `pgque` inside the compound word `pgqueue`. The substring rewrite
   turned `"pgqueue"` (a legitimate boundary-case example in a
   transform.sh comment) into the nonsense string `"logresue"`,
   which defeated the point of the comment. Restored to `"pgqueue"`.

The Python class is now LogresClient (was PgqueClient). The TS types
are LogresClient / LogresMessage. The Go code did not expose a
Pgque-prefixed exported name; only its env var is touched.

Remaining DevRel-review-flagged items (CLAUDE.md Naming Convention
section reads awkwardly post-rename, mild prose lowercase issues)
deferred to the DevRel review's incoming patch list.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
DevRel review of #76 flagged four concrete things cold readers hit.
Two were already resolved by the earlier case-variant commit (the
Python / TypeScript class-identifier renames). The remaining four:

1. CLAUDE.md was a sed-residue mess. Line 5 read "logres (logres)";
   lines 10-11 both said `logres` — the lowercase/capitalized split
   from PgQue no longer applies now that the name is always
   lowercase. Line 88 had `logres-unlogres.sql` from the substring
   rewrite.

   Rewrite the Project line, collapse the naming-convention bullets
   to one, and restore the uninstall filename to the actual path
   `logres_uninstall.sql`.

2. README.md had a frame contradiction. Line 40 said "zero-bloat
   queue pattern"; line 61 said "logres gives you queue semantics
   inside Postgres"; line 95 said "logres is an event/message queue
   optimized for high-throughput streaming" — and then the new §109
   heading said "Log, not task queue." Within 60 lines the reader
   was told "queue" three times and "log" twice.

   - Line 40: "zero-bloat event-log pattern" (was "queue pattern").
   - Line 61: "event-log semantics" (was "queue semantics").
   - Line 95 Category note: "shared event log with per-consumer
     cursors — a different category (closer to a Kafka topic than
     to a job queue)." Replaces "event/message queue optimized for
     high-throughput streaming".

3. README.md §"Log, not task queue" leaned on "per-key ordered
   processing (partition by key)" as a marquee good-fit case. logres
   has no partition primitive. Rewrite the bullet to name the actual
   mechanism: "For per-key ordered processing, use one queue per
   partition key — each queue is already a FIFO log for its events
   (logres has no native partition primitive; the mechanism is
   multi-queue)." Also fix the "head-of-lines the partition"
   follow-up → "head-of-lines whichever queue it is in."

4. blueprints/SPECx.md rename banner used to link only README.md
   and PHASES.md. DevRel asked for a docs/reference.md link too
   since a reader hitting SPECx from a deep link wants the current
   SQL surface names without leaving the spec. Added.

Deferred: the remaining DevRel LOW / nit items (docs/benchmarks.md
"queue-heavy workloads", SPECx per-section reminder notes,
TypeScript package name shape). These are tone-level and can
land in a separate follow-up if worth it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous rename fix commit (5dad160) aimed at four DevRel findings
but CLAUDE.md edits were dropped due to a concurrent-modification
error. Retry:

- Line 5-6: rewrite the "Project" paragraph. Old: "logres (logres)
  -- PgQ Universal Edition. Zero-bloat PostgreSQL queue repackaged..."
  (tautology + outdated "queue" frame). New: "logres -- zero-bloat
  event log for Postgres, derived from PgQ (Skype)...".
- Lines 8-12: collapse "Naming Convention" section. Old: `logres`
  listed on both "lowercase" and "capitalized form" lines (sed
  artifact from PgQue / pgque split that no longer applies). New:
  one bullet, "always lowercase", matching pg_cron / pgmq convention.
- Line 87: `logres-unlogres.sql` (substring-mangled from
  `pgque-unpgque.sql`) -> `logres_uninstall.sql` (actual filename).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@NikolayS NikolayS marked this pull request as draft April 19, 2026 15:54
@NikolayS NikolayS changed the title refactor: rename to logres; clarify log vs task queue refactor: rename to XXX; clarify log vs task queue Apr 19, 2026
@NikolayS NikolayS closed this Apr 30, 2026
@NikolayS NikolayS deleted the rename/logres branch April 30, 2026 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant