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

Postgres Display actual query error #530

Open
eqbalz opened this issue Apr 30, 2024 · 0 comments
Open

Postgres Display actual query error #530

eqbalz opened this issue Apr 30, 2024 · 0 comments

Comments

@eqbalz
Copy link

eqbalz commented Apr 30, 2024

I am running a simple lua script with sysbench like the following:

-- custom_reads.lua

function prepare()
-- Prepare the database connection
end

function event()
-- Execute your custom insert queries here
-- Example:
local success, result = pcall(db_query, "Select * from testtable TABLESAMPLE SYSTEM_ROWS(1);")

if success then
-- Code to handle success (optional)
else
-- Code to handle error
print("Error:", result)
end
end

function cleanup()
-- Cleanup resources after the test
end

I would like to display the actual error message if query is cancelled by database for example:

ERROR: canceling statement due to conflict with recovery DETAIL: User was holding shared buffer pin for too long. CONTEXT: SQL statement ...

However print shows something like this:

Error:  table: 0x4194aef8

Any suggestions?

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

No branches or pull requests

1 participant