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

Change stored procedures schema name

From: Mainor Alonso Morales González <mmorales(at)ncq(dot)co(dot)cr>
To: pgsql-admin(at)postgresql(dot)org
Subject: Change stored procedures schema name
Date: 2009-08-06 20:23:53
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
There exist any way to change the name of my stored procedures schemas 
but the code used inside of them???
for example:

I have this stored procedure:

CREATE OR REPLACE FUNCTION schema1.example(double precision) RETURNS 
numeric AS
    pIn    ALIAS FOR $1;   
    insert into schema1.table values(pIn,0); --this is just an example :)
    return 0;

If I change the schema name using PGADMIN it just change this part:

    CREATE OR REPLACE FUNCTION new_schema.example(double precision) 
RETURNS numeric AS

I'm asking about any way to change the schema of the command inside of 
the code automatically, because I have many
stored procedure in the database (about 63) and this process could take 
so much time, I hope had been clear, sorry about
my bad english :S



pgsql-admin by date

Next:From: Alvaro HerreraDate: 2009-08-06 21:22:30
Subject: Re: Change stored procedures schema name
Previous:From: Steve CrawfordDate: 2009-08-05 23:46:01
Subject: Re: error from postgresql 8.4.0 after a dump/restore from 8.3.5

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