SQLStreams

the messaging platform that is just Postgres

You last visited on 9999-99-99 Show what's new since then
[SOLVED]

stream partitions remain after draining [SQL0020]

Edit this page
code SQL0020 · recovery permanent — an unchanged retry cannot succeed; retry machinery stops immediately
the log line · Report this thread
SQL0020 Permanent error

As it arrives in your log or error chain — example values stand where yours will:

stream partitions remain after draining: schema "sqlstreams", stream_id 1 -- stop the stream's producers and call Client.Stream(name).Destroy again [SQL0020]
ACCEPTED ANSWER Posted: 2026-09-09
brandon Site Admin brandon profile Posts: 677

stop the stream's producers and call Client.Stream(name).Destroy again

brandon Site Admin brandon profile Posts: 677

Helpful info.

  1. the partitions still attached to the log

    SELECT partition.relname AS partition
    FROM pg_inherits
    JOIN pg_class AS partition ON partition.oid = pg_inherits.inhrelid
    WHERE pg_inherits.inhparent = to_regclass('{schema}.message_log_{stream_id}')
    ORDER BY partition.relname;
  2. whether a producer is still writing -- run it twice

    SELECT max(id) AS head, count(*) AS message_count FROM {schema}.message_log_{stream_id};
Nothing pasted yet — the queries above show their blanks.

Looking for a different code? Search every thread.