Michael Zouroudis <mzouroudis(at)idealcorp(dot)com> writes:
> when i run this i get a parse error at or near "assets_asset_id_seq".
You need to double those quote marks, viz
... currval(''mom_mom_id_seq'') ...
Or you can backslash 'em (\'). The point is that the function body
begins life as a string literal, and so you have to get it through the
string-literal parser.
regards, tom lane