On May 1, 2007, at 12:16 PM, Jonah H. Harris wrote:
On 5/1/07, Collin Peters <[EMAIL PROTECTED]> wrote:
Is it faster to use PREPARE for the various INSERT statements inside a
plpgsql function?  Perhaps I am wrong and it does its PREPARE work
when the function is parsed.

IIRC, PLpgSQL automagically prepares each statement behind the scenes
on the first use.

BTW, a good use for a version of EXECUTE that accepted parameters is the trigger on a partitioned table to direct inserts to the appropriate partition. Currently, you have to quote_literal(coalesce (NEW.field, 'NULL')) in the dynamic statement.
--
Jim Nasby                                            [EMAIL PROTECTED]
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)



---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
      choose an index scan if your joining column's datatypes do not
      match

Reply via email to