Skip to content

Place Supabase pg_stat_statements in extensions schema#747

Open
jingsam wants to merge 1 commit into
pgsty:mainfrom
jingsam:codex/supabase
Open

Place Supabase pg_stat_statements in extensions schema#747
jingsam wants to merge 1 commit into
pgsty:mainfrom
jingsam:codex/supabase

Conversation

@jingsam
Copy link
Copy Markdown
Contributor

@jingsam jingsam commented May 18, 2026

Summary

  • create pg_stat_statements in the extensions schema for the Supabase config template
  • keep it in pg_default_extensions so the extension remains part of the default database extension set

Reason

Supabase Studio's Query Performance page expects pg_stat_statements to be available from the extensions schema. The previous template created pg_stat_statements in the monitor schema, which can prevent that Supabase feature from locating the extension as expected.

Tests

  • Not run; configuration-only change.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a2432fc372

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread conf/supabase.yml
- { name: intagg ,schema: extensions }
- { name: intarray ,schema: extensions }
- { name: pg_repack ,schema: extensions }
- { name: pg_stat_statements ,schema: extensions }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep pg_stat_statements reachable for pg_exporter

When Supabase uses the bundled PostgreSQL monitoring, this creates pg_stat_statements only in extensions, but the generated init SQL still sets the monitor user search path to monitor,public (roles/pgsql/templates/pg-init-template.sql:111) and pg_exporter connects as that user (roles/pg_monitor/templates/pg_exporter.env:7) while running unqualified FROM pg_stat_statements(false) queries (roles/pg_monitor/templates/pg_exporter.yml:1331). Those collector queries will fail with “function does not exist” for Supabase deployments unless the monitor search path is also updated or the exporter queries are schema-qualified, so query-performance metrics are lost.

Useful? React with 👍 / 👎.

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