> On Feb 11, 2019, at 12:25 PM, Pepe TD Vo <pepevo@xxxxxxxxx> wrote: > > insert into cidrmgmt.errorlog(...) For what it's worth, it seems likely the error is coming from that line (assuming you posted the correct procedure definition), thus that's the table whose definition matters. Further, the bad value is likely coming from the context, and there's no info here that would help figure out why there's "42P01" where an integer is required. But I can tell you that PG's nearest equivalent of Oracle's sys_context is untyped, always a string, so there would have to be a cast to an integer type. But of course you can't cast 42P01 to an integer, so that has to be figured out first.