Обсуждение: how to check presence of a function and set permissions?

Поиск
Список
Период
Сортировка

how to check presence of a function and set permissions?

От
bboett@erm1.u-strasbg.fr (Bruno Boettcher)
Дата:
hello!

since i am now destroying and recreating my functions at every request
(due to the fact that pl/psql can't cope with dynamic table names, and i
didn't found anywhere a decent doc about pl/perl) i have now the
problem, that a psql error is displayed if i try to drop  a nonexistent
function, or sometimes when i created the function through psql an
ownership error, giving a permission denied to drop that function...

so is there a way to check before dropping if a function exists, and is
it possible to ovverride the ownership of a function? do the same GRANT
mechanisms aply to functions (at least the syntax has to change a
bit...)?

-- 
ciao bboett
==============================================================
bboett@earthling.net
http://inforezo.u-strasbg.fr/~bboett http://erm1.u-strasbg.fr/~bboett
===============================================================
the total amount of intelligence on earth is constant.
human population is growing....


Re: how to check presence of a function and set permissions?

От
Tod McQuillin
Дата:
On Mon, 21 May 2001, Bruno Boettcher wrote:

> since i am now destroying and recreating my functions at every request
> (due to the fact that pl/psql can't cope with dynamic table names,

I don't know about the rest of your question but I believe PostgreSQL
supports dynamic queries in plpgsql since v7.1 --

EXECUTE 'SELECT * FROM ' || table_name || ' WHERE whatever';

However, I do not see it in the documentation, so now I'm not 100%
certain.
-- 
Tod McQuillin




Re: how to check presence of a function and set permissions?

От
Bruce Momjian
Дата:
I see EXECUTE in the PL/PgSQL manual.

> On Mon, 21 May 2001, Bruno Boettcher wrote:
> 
> > since i am now destroying and recreating my functions at every request
> > (due to the fact that pl/psql can't cope with dynamic table names,
> 
> I don't know about the rest of your question but I believe PostgreSQL
> supports dynamic queries in plpgsql since v7.1 --
> 
> EXECUTE 'SELECT * FROM ' || table_name || ' WHERE whatever';
> 
> However, I do not see it in the documentation, so now I'm not 100%
> certain.
> -- 
> Tod McQuillin
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
> 

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026