On Sat, 26 Jun 2021, Tom Lane wrote:
> You probably would have better results from specifying the composite
> type explicitly in the query:
>
> PQexecParams("insert into sometable values($1::composite, ...);",
>
> I gather from the complaint that you're currently doing something that
> causes the Param to be typed as a generic "record", which is problematic
> since the record's details are not available from anyplace. But if you
> cast it directly to a named composite type, that should work.
>
> If it still doesn't work, please provide a more concrete example.
Thanks, unfortunately adding the explicit cast doesn't help. I've
attached a minimal runnable example.
I am serializing as a generic record, so it occurs to me that another
solution would be to use the actual type of the composite in question.
(Though it also seems to me that my code should work as-is.) Is there a
way to discover the OID of a composite type? And is the wire format the
same as for a generic record?
-E