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

From Robert Haas
Subject Re: UPDATE pg_catalog.pg_proc.prosrc OK?
Date
Msg-id AANLkTiks0SwM-4DYba-GGNjSE99P6daOKc_t_iVtYy5-@mail.gmail.com
Whole thread Raw
In response to UPDATE pg_catalog.pg_proc.prosrc OK?  (Joel Jacobson <joel@gluefinance.com>)
Responses Re: UPDATE pg_catalog.pg_proc.prosrc OK?  (Joel Jacobson <joel@gluefinance.com>)
List pgsql-hackers
n Mon, Dec 27, 2010 at 1:23 PM, Joel Jacobson <joel@gluefinance.com> wrote:
> I'm working on a tool to simplify updating the source code of database
> functions.
> To do a "revert" my plan is to store the values of pg_proc.* before
> updating, and then to restore pg_proc for the given oid if a revert is
> necessary.
> This raises the question,
> Is it "safe" to do,
> UPDATE pg_proc SET <column> = <new source code> WHERE oid = <function's
> oid>;
> instead of using the "CREATE OR REPLACE FUNCTION" command?

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.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: "writable CTEs"
Next
From: Magnus Hagander
Date:
Subject: Libpq PGRES_COPY_BOTH - version compatibility