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

An unhandled postgres error #15

Open
dawkot opened this issue Oct 28, 2019 · 1 comment
Open

An unhandled postgres error #15

dawkot opened this issue Oct 28, 2019 · 1 comment

Comments

@dawkot
Copy link

dawkot commented Oct 28, 2019

Example

Consider db to be a valid connection and table to be a valid table

echo "a"
discard db.get_value sql "SELECT 1 FROM table WHERE false"
echo "b"

Current Output

a
row number 0 is out of range 0..-1
b

Expected Output

a

Possible Solution

  • Silence the output and raise an exception instead

Additional Information

The above error happens if a program calls PQgetvalue(), PQgetlength(),
or PQgetisnull() with a row number of -1 and if there were no rows
in the result.
https://www.postgresql.org/message-id/014c01c57be2$60b97780$3202a8c0@pi

$ nim -v
Nim Compiler Version 1.0.99 [Windows: amd64]
@Araq
Copy link
Member

Araq commented Oct 29, 2019

In what universe is dumping stuff to the terminal a viable error reporting strategy? I thought Postge is a piece of quality... :-(

@ringabout ringabout transferred this issue from nim-lang/Nim Dec 8, 2022
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

2 participants