"Conrad Vermeulen" <[EMAIL PROTECTED]> writes: > Possibly my quick hack may not work if the parser > predetermines the type as the functionality required would only really be > able to determine the type at time of execution.
The problem is that the first time through, the execution plan for the command or expression is generated and cached. So you can't change the type of the field dereference later. plpgsql is really not designed for this sort of thing; it's designed to be fast with predictable data types. Use pltcl or plperl instead. There's a reason why we support multiple PLs ;-) I agree that it would be good to fix EXECUTE so that one could refer to NEW or OLD in the constructed query (and other plpgsql variables too). I believe this would take a rather serious overhaul of plpgsql's parser though ... regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings