Skip to content

Add schema version tracking - #844

Open
seanlinsley wants to merge 1 commit into
mainfrom
schema-version
Open

Add schema version tracking#844
seanlinsley wants to merge 1 commit into
mainfrom
schema-version

Conversation

@seanlinsley

Copy link
Copy Markdown
Member

This adds a schema_version to snapshots, allowing us to signal when the schema structure has significantly changed such that the pganalyze server needs to force a re-sync of the data (like #196 needed) or otherwise handle it specially (other than checking for optional fields, like normally done).

Since we haven't been using snapshot_version_major and snapshot_version_minor, and we don't foresee a need for minor version tracking, this PR renames them to snapshot_version and schema_version to avoid needing to add a new field.

@seanlinsley
seanlinsley requested a review from a team July 27, 2026 15:47
Comment thread output/full.go
s.SnapshotVersionMajor = 1
s.SnapshotVersionMinor = 0
s.SnapshotVersion = 1
s.SchemaVersion = 1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This PR still doesn't include the part of "allowing us to signal when the schema structure has significantly changed", right? (as simply putting 1 here)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The internal PR paired with this starts using schema version as part of schema table change detection logic. Was there something else you had in mind?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry, I completely misunderstood that part, never mind 🤦

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.

3 participants