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

How to correct schema-names within function when the schema gets renamed?

From: Andreas <maps(dot)on(at)gmx(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: How to correct schema-names within function when the schema gets renamed?
Date: 2011-08-29 11:44:19
Message-ID: 4E5B7B93.2070509@gmx.net (view raw or flat)
Thread:
Lists: pgsql-novice
Hi,
how can I correct schema-names within function when the schema gets renamed?
PG corrects automagicaly every view and foreign key.

Though I found that it doesn't update the schema-name in sql-functions.
Say there where a table "bar" in the schema "foo"
and there is a function f(int) that results to "select * from foo.bar 
where id = $1".

Then I rename "foo" to "sansi" and all seems nice till I call f().
Now I get an error that schema "foo" can't be found.

How could I find all functions that use the now uncorrect schema-name?

Btw, server is PG 8.4.

Responses

pgsql-novice by date

Next:From: pasman pasmaƄskiDate: 2011-08-29 11:55:22
Subject: Re: nice updates
Previous:From: ennioDate: 2011-08-24 15:33:54
Subject: Re: Data corruption after an update set ...?

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