K
Kysely9mo ago
djMax

How do I type the arguments to a function?

I am calling a stored proc with parameters (we have very few, but some make the client's life a lot easier and make transactions shorter). I get an error that it can't find the function given the types:
function my_favorite_function(unknown, unknown, unknown)
function my_favorite_function(unknown, unknown, unknown)
I'm calling it like:
select my_favorite_function(someString, someNumber, someJsonCodableObject)
select my_favorite_function(someString, someNumber, someJsonCodableObject)
Do I need to just cast each one in the SQL?
1 Reply
djMax
djMax9mo ago
Actually I think the problem is more subtle than I thought. I'm passing an object in those params and expecting it to be json in pg, but perhaps this needs JSON encoding on the client side first?