aditya desai <admad123@gmail.com> writes:
> Thanks Jean. However I am trying this inside procedure and getting an
> error. Will try to send screenshot.
That's frowned on around here. Can't you copy-and-paste the code
and the error message?
As Jean-Marc says, you shouldn't really need a defined CAST
object to cast to or from text; Postgres will interpret that
as a request to apply the datatype's I/O functions.
You can formalize that by creating a cast "WITH INOUT", but
you shouldn't need to, so I think your problem here is something
different from what you said. Hard to give more advice without
seeing the problem code and the specific error.
regards, tom lane