Skip to content

Polish: subscribe/unsubscribe file location, dlq_replay rationale, SPECx role-split note, test teardown #166

@NikolayS

Description

@NikolayS

Follow-up to #163 (REV round-1 + round-2 finding).

Three small docs gaps that should be polished but did not block the producer/consumer role split:

1. subscribe / unsubscribe source-located in send.sql

docs/reference.md:104 and :109 say Source: sql/pgque-api/send.sql for the consumer-side subscribe and unsubscribe wrappers. A reader following the source link expects send-side code and finds something different. Either:

  • Move subscribe()/unsubscribe() to sql/pgque-api/receive.sql (or a new subscribe.sql) and update reference.md, or
  • Add a one-line note in reference.md: Source: sql/pgque-api/send.sql (co-located with send-side wrappers; the file covers both produce and subscription management).

2. dlq_replay / dlq_replay_all writer-side rationale missing

sql/pgque-additions/dlq.sql:213 says only "dlq_replay / dlq_replay_all re-insert events — writer-level." docs/reference.md:307,319 shows Grant: pgque_writer with no rationale.

Add a parenthetical in dlq.sql: (writer-level because replay calls insert_event(), the canonical produce primitive — replaying is a produce action, not a consume action). Mirror in reference.md.

3. blueprints/SPECx.md:1999-2001 stale role description

Lines from Sprint-1 test bullets:

pgque_reader can call get_queue_info() but not insert_event()
pgque_writer can call insert_event() but not drop_queue()

These do not state the sibling relationship. After line 2001, add:

pgque_writer does not inherit pgque_reader (siblings, not parent/child;
see #102, #106, #163).

4. (minor) Test final teardown polish

tests/test_security_producer_isolation.sql final teardown drops producer_only and consumer_only without first running revoke all privileges on schema pgque from <role>. The idempotent preamble does this; mirror it in the bottom-of-file teardown so a future addition that grants schema privileges to those test roles doesn't break drop.

All four are low-risk doc/polish changes. No code behavior changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationengineerOwned by an engineer agent (do work, open PR)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions