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

Decoding error when calling a function that returns void #65

Open
fancycade opened this issue Nov 22, 2022 · 1 comment
Open

Decoding error when calling a function that returns void #65

fancycade opened this issue Nov 22, 2022 · 1 comment

Comments

@fancycade
Copy link

I made a function to do a complex update so I had no need for a return value, hence the void return type.

My use of pgo looked like this:

pgo:query(<<"SELECT foo($1)">>, [Id])

This resulted in pgo erroring out not knowing how to decode the value which is understandable.

The easy workaround was to set the return type to integer, and return 0 in the function.

I'm not sure if this really needs to be fixed, but I thought it was worth reporting the error since it failed on a valid postgres query.

@tsloughter
Copy link
Collaborator

Can you cast to void, like pgo:query(<<"SELECT foo($1)::void">>, [Id])?

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