Visitar URL original
Declarative (SDL) rollout fails on Spilo/postgres-operator databases: type "pg_stat_statements" does not exist (SQLSTATE 42704) · Issue #21241 · bytebase/bytebase · GitHub
Skip to content

Declarative (SDL) rollout fails on Spilo/postgres-operator databases: type "pg_stat_statements" does not exist (SQLSTATE 42704) #21241

Description

@chriskovaios

Provide the Bytebase version you are using

3.21.0

Describe the bug

Hey again, thanks for the incredible support in regards to my previous issue #20434 !!

I'd like to report one more problem relative to one of my previous bugs, which came after the fixes.

Apparently the "metric_helpers" error came from Zalando's Spilo Wrapper, in which they have a function called pg_stat_statements as stated below.
metric_helpers.sql :

CREATE EXTENSION pg_stat_statements;
CREATE SCHEMA metric_helpers;
CREATE FUNCTION metric_helpers.pg_stat_statements(showtext boolean)
 RETURNS SETOF public.pg_stat_statements
 LANGUAGE sql IMMUTABLE STRICT SECURITY DEFINER
AS $$ SELECT * FROM public.pg_stat_statements(showtext) $$;

Steps to reproduce

Trying to create a rollout with a bootstrapped postgres out of the box Zalando Spilo's postgres-operator will reproduce the error.

Expected behavior

SDL to work properly for DDL

Provide the database you are using

PostgreSQL v16 LTS

Additional context

I've run this problem through Claude and it's suggested solution goes like this:

Add pg_stat_statements to the bundled extensionScripts map with a minimal script
declaring the pg_stat_statements view (a superset column list across extension versions
is sufficient for DDL semantic analysis), like the existing bundles for
citext/hstore/pg_trgm/vector. pg_stat_kcache and pg_auth_mon (also installed by Spilo
by default) may deserve the same treatment.

Activity

  1. zchpeter commented on Sep 3, 2026

    @zchpeter
    Collaborator

    Hi @chriskovaios , thanks for flagging this issue, we have filed an internal ticket BYT-10142.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions