Обсуждение: UPDATE pg_language SET lanpltrusted=true WHERE lanname='plpgsql'

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

UPDATE pg_language SET lanpltrusted=true WHERE lanname='plpgsql'

От
PeterKorman
Дата:
I have:

---------------------------------------------------------------------

template1=# select * from pg_language;
lanname  | lanispl | lanpltrusted | lanplcallfoid | lancompiler
----------+---------+--------------+---------------+-------------internal | f       | f            |             0 |
n/aC       | f       | f            |             0 | /bin/ccsql      | f       | f            |             0 |
postgresplpgsql | t       | f            |         16709 | PL/pgSQL
 
(4 rows)

---------------------------------------------------------------------

I wanna do this:


---------------------------------------------------------------------
UPDATE pg_language SET lanpltrusted=true WHERE lanname='plpgsql';
---------------------------------------------------------------------

Is this gonna break anything? That is, are there dependencies
in this table that I will break or otherwise compromise if I 
perform the above sql update. Does the effect of:

'CREATE TRUSTED LANGUAGE'

differ from: 

'CREATE LANGUAGE', 


some way other than setting true, the 'lanpltrusted' column of 
the 'plpgsql' row, of the 'pg_language' table?

I understand that my other option is to delete the language 
and then add it create it
again with:


---------------------------------------------------------------------
drop language 'plpgsql';
drop function 'plpgsql_call_handler';

CREATE FUNCTION plpgsql_call_handler ()               RETURNS OPAQUE               AS '/usr/lib/postgresql/plpgsql.so'
            LANGUAGE 'C';
 

CREATE TRUSTED LANGUAGE 'plpgsql' HANDLER plpgsql_call_handler               LANCOMPILER 'PL/pgSQL';
---------------------------------------------------------------------

Thanks.
Cheers,


JPK



Re: UPDATE pg_language SET lanpltrusted=true WHERE lanname='plpgsql'

От
Tom Lane
Дата:
PeterKorman <calvin-pgsql-ml@eigenvision.com> writes:
> I wanna do this:
> UPDATE pg_language SET lanpltrusted=true WHERE lanname='plpgsql';

Should be okay.  Next time, create your languages with the createlang
script ...
        regards, tom lane