"Collin Peters" <cadiolis(at)gmail(dot)com> writes:
> So if I have an INSERT inside a LOOP in a plpgsql function, it is only
> prepared once?
Once per session, yes (barring some special cases like polymorphic
functions and trigger functions, which would get prepared once per
session per calling situation)
regards, tom lane