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.
The following query works:
but this does not:
The
ToField
instance forUUID
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'sToField
instances and generate query strings parametrically.