Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For PG truncate, fetch last_value from sequence #103

Merged
merged 1 commit into from
Jul 12, 2024

Conversation

cwjenkins
Copy link
Contributor

@cwjenkins cwjenkins commented May 2, 2024

With HEAD, receiving ERROR: currval of sequence ... given currval isn't defined until nextval is invoked 'per session'.
https://www.postgresql.org/docs/current/functions-sequence.html

Therefore looking up what's been persisted whether it was atomically incremented via nextval or manual shifted by something else.

@cwjenkins cwjenkins changed the title For PG truncate, fetch last value from sequence given currval is session based For PG truncate, fetch last_value from sequence May 2, 2024
Copy link
Member

@etagwerker etagwerker left a comment

Choose a reason for hiding this comment

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

@cwjenkins Looks good, thank you!

@etagwerker etagwerker merged commit ecdc7eb into DatabaseCleaner:main Jul 12, 2024
1 check passed
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