Repository navigation
Conversation
Migrating existing integer IDs into a PostgreSQL-dialect table skips reserved ranges on a bit-reversed sequence via ALTER SEQUENCE ... SKIP RANGE. Add spanner_postgresql_alter_sequence.
|
Here is the summary of changes. You are about to add 1 region tag.
This comment is generated by snippet-bot.
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new script and corresponding tests to alter a PostgreSQL bit-reversed sequence 'SKIP RANGE' and insert rows in a Spanner database with a PostgreSQL dialect. Specifically, it adds 'postgresql_alter_sequence.py' to perform the DDL update and transaction execution, and 'postgresql_alter_sequence_test.py' to verify the functionality through unit and live tests. There are no review comments, and we have no feedback to provide.
…ence Problem: the sample waits on a long-running operation with a client-side timeout. When that wait expires the client raises TimeoutError, which is not an API call error, so the sample ended with an unhandled traceback. Solution: catch TimeoutError and print a clear message to stderr noting that only the wait timed out and the operation may still be running (the timeout does not cancel it). Add a unit test covering the new handler.
…uence Problem: multi-line SQL and DDL statements were written as adjacent string fragments. That style is easy to get wrong (a missing trailing space joins two SQL tokens) and is harder to read than the statement itself, and the samples in this set mixed it with triple-quoted SQL. Solution: write each multi-line statement as a single triple-quoted string, matching the layout already used by the other samples. Only whitespace between SQL tokens changes; the statements are otherwise identical. Files updated: - spanner/postgresql/src/spanner_postgresql/postgresql_alter_sequence.py
Description
Adds
spanner_postgresql_alter_sequenceconfiguringSKIP RANGEon a PostgreSQL bit-reversed sequence and inserting rows.Checklist
Testing
Compliance & Style
spanner/, which the default repository owners cover.Post-Approval Actions