Re: UPDATE pg_catalog.pg_proc.prosrc OK? - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: UPDATE pg_catalog.pg_proc.prosrc OK?
Date
Msg-id 4D19E5FB.9030500@enterprisedb.com
Whole thread Raw
In response to Re: UPDATE pg_catalog.pg_proc.prosrc OK?  (Joel Jacobson <joel@gluefinance.com>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Joel Jacobson
Date:
Subject: Re: UPDATE pg_catalog.pg_proc.prosrc OK?
Next
From: Magnus Hagander
Date:
Subject: pg_primary_conninfo