Skip site navigation (1) Skip section navigation (2)

Re: UPDATE pg_catalog.pg_proc.prosrc OK?

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Joel Jacobson <joel(at)gluefinance(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: UPDATE pg_catalog.pg_proc.prosrc OK?
Date: 2010-12-28 12:11:03
Message-ID: AANLkTiks0SwM-4DYba-GGNjSE99P6daOKc_t_iVtYy5-@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
n Mon, Dec 27, 2010 at 1:23 PM, Joel Jacobson <joel(at)gluefinance(dot)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

In response to

Responses

pgsql-hackers by date

Next:From: Magnus HaganderDate: 2010-12-28 12:13:41
Subject: Libpq PGRES_COPY_BOTH - version compatibility
Previous:From: Robert HaasDate: 2010-12-28 12:09:14
Subject: Re: "writable CTEs"

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group