Thomas Hallgren <thomas(at)tada(dot)se> writes:
> Hmm, OK. I checked my code and I don't use any specific type. Instead, I
> use SPI_getargtypeid(ePlan, idx) on the prepared query and the
> pgType->typinput function of the type that corresponds to the returned
> oid. Perhaps the SPI_getargtypeid should return varchar for all text types?
Certainly not. That would break most normal uses of SPI_getargtypeid,
and I don't even see how it fixes your problem; once the query is
prepared these decisions are already made.
regards, tom lane