I wonder if there's a way to process the RPC encoding inside a stored procedure, using the various JS-in-DB features out there.