Skip to content

Ignore per-session temp schemas in inferred migrations#1027

Open
JoeyEamigh wants to merge 1 commit into
xataio:mainfrom
JoeyEamigh:ignore-per-session-temp
Open

Ignore per-session temp schemas in inferred migrations#1027
JoeyEamigh wants to merge 1 commit into
xataio:mainfrom
JoeyEamigh:ignore-per-session-temp

Conversation

@JoeyEamigh

Copy link
Copy Markdown

The pg_roll_handle_ddl event trigger in pkg/state/init.sql records an inferred row in pgroll.migrations for any DDL that happens outside a pgroll-owned connection. It filters pgroll's own sessions via pgroll.no_inferred_migrations, but it doesn't exclude PostgreSQL temp schemas.

I have been running pgroll in prod for ~2 months and have 291 inferred rows on pg_temp schemas. It's not harmful by any stretch, but is messy.

This PR adds a name-prefix guard in placeholder.raw_migration() that filters temp tables and a test.

@github-actions github-actions Bot temporarily deployed to Docs Preview April 15, 2026 04:08 Inactive

@exekias exekias left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for contributing! this change makes sense to me, WDYT @andrew-farries ?

@exekias exekias closed this May 26, 2026
@exekias exekias reopened this May 26, 2026
@github-actions github-actions Bot temporarily deployed to Docs Preview May 26, 2026 08:20 Inactive
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.

2 participants