Louis-David Mitterrand <vindex+lists-pgsql-sql(at)apartia(dot)org> writes:
> I'd like to use it on other tables an columns but how can the column
> name be dynamic inside the procedure.
It can't --- plpgsql has no support for that. You could probably make
it work in some of the other PL languages, such as plperl or pltcl,
which are less strongly typed.
regards, tom lane