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

UUID ToField instance doesn't work when type can't be inferred from context #277

Open
kmicklas opened this issue Mar 14, 2021 · 0 comments

Comments

@kmicklas
Copy link

The following query works:

select uuid_generate_v3(t.x, 'foo') from (values ('55c163fc-8e21-4f2a-b26d-6a7fa3e5d896'::uuid)) as t(x);

but this does not:

select uuid_generate_v3(t.x, 'foo') from (values ('55c163fc-8e21-4f2a-b26d-6a7fa3e5d896')) as t(x);

The ToField instance for UUID only outputs the quoted text, so it will fail when interpolated into a query like the second one. I guess if you're using postgresql-simple directly you can just know to append ::uuid in the query text, but this is a problem for higher level query libraries like Beam which would like to reuse postgresql-simple's ToField instances and generate query strings parametrically.

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