On 28.12.2010 15:19, Joel Jacobson wrote:
> 2010/12/28 Robert Haas<robertmhaas@gmail.com>
>
>> I'm not immediately sure whether it's safe, but it seems like playing
>> with fire, and I don't see any particular advantage to doing it this
>> way over using CREATE OR REPLACE FUNCTION.
>
> While I understand some of the SQL commands affecting pg_catalog have side
> effects, such as CREATE DATABASE, others seems to lack side effects.
>
> To use CREATE OR REPLACE FUNCTION, I would have to assemble SQL from the
> data in pg_proc.* for each function, which is quite a complex task (e.g.,
> pg_dump does this, and it's far from trivial, due to differences between
> different versions etc).
Since 8.4, there is a function called pg_get_functiondef() which does
all the hard work. Or you could use pg_dump.
-- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com