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

txid over max_int4 #560

Closed
chenminhua opened this issue Apr 13, 2023 · 1 comment · Fixed by #561
Closed

txid over max_int4 #560

chenminhua opened this issue Apr 13, 2023 · 1 comment · Fixed by #561
Assignees
Labels
🐞 bug Something isn't working ⚡ priority This issue if of high priority, but not critical

Comments

@chenminhua
Copy link

Describe the bug
Transaction id overflow (over max_int4 2147483647). https://github.com/cybertec-postgresql/pg_timetable/blob/master/internal/pgengine/sql/migrations/00436.sql

 [ERROR] [sql:INSERT INTO timetable.execution_log (
chain_id, task_id, command, kind, last_run, finished, returncode, pid, output, client_name, txid)
VALUES ($1, $2, $3, $4, clock_timestamp() - $5 :: interval, clock_timestamp(), $6, $7, NULLIF($8, ''), $9, $10)] [args:[2 2 SELECT XXXXXX SQL 1.692292 seconds 0 1307515472 SELECT 1 test2 6630182314]] [err:failed to encode args[9]: unable to encode 6630182314 into binary format for int4 (OID 23): 6630182314 is greater than maximum value for int4] [pid:3286] [time:422.842µs]

I think the txid should be bigint instead of INTEGER type. I'd like to contribute but I not very sure about the methodology of migration in this project.

@pashagolub pashagolub self-assigned this Apr 13, 2023
@pashagolub pashagolub added 🐞 bug Something isn't working ⚡ priority This issue if of high priority, but not critical labels Apr 13, 2023
@pashagolub
Copy link
Collaborator

Thanks for reporting this. If you're interested in how migrations applied, please, check this commit.

It's usually 3 files. The dbapi value and a migration file name are the number of the issue, in this case 00560

pashagolub added a commit that referenced this issue Apr 20, 2023
[-] alter timetable.execution_log.txid column type to bigint, fixes #560
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working ⚡ priority This issue if of high priority, but not critical
Projects
None yet
2 participants