www.emsdn.com
Class Profile: Home »» Databases [Databases] under "Databases" »»» procedural languages and public schema

procedural languages and public schema


What are the implications between the use of a pl language and the
public schema?
When i use createlang on a database without the public schema (dropped
for safety reason), createlang fail with the sequent error
postgres@pc-dba:~createlang -d prova2 plpgsql
SELECT oid FRM pg_language WHERE lanname = 'plpgsql';
SELECT oid FRM pg_proc WHERE proname = 'plpgsql_call_handler' AND
prorettype = 'pg_catalog.language_handler'::regtype AND pronargs = 0;
SELECT oid FRM pg_proc WHERE proname = 'plpgsql_validator' AND
proargtypes[0] = 'pg_catalog.oid'::regtype AND pronargs = 1;
CREATE FUNCTIN "plpgsql_call_handler" () RETURNS language_handler AS
'$libdir/plpgsql' LANGUAGE C;
CREATE FUNCTIN "plpgsql_validator" (oid) RETURNS void AS
'$libdir/plpgsql' LANGUAGE C;
CREATE TRUSTED LANGUAGE "plpgsql" HANDLER "plpgsql_call_handler"
VALIDATR "plpgsql_validator";
createlang: language installation failed: ERRR: no schema has been
selected to create in
postgres@pc-dba:~>
If i recreate the public schema (as default) the createlang perform
without error.
The client 'createlang' attempt to create 2 functions on the public schema:
plxxx_call_handler
plxxx_validator
these function have got respectively null acl list, from pg_proc:
prova2=# select pg_proc.oid, proname, nspname, proacl from pg_proc,
pg_namespace where pg_namespace.nspname='public' and
pg_namespace.oid=pronamespace;
oid | proname | nspname | proacl
571455 | plpgsql_call_handler | public |
571456 | plpgsql_validator | public |
(2 rows)
prova2=#
Can i create languages functions on a different schema?
This schema must be accessible for all db user? With which privileges
(only usage)?
What's the mean of the proacl column for these functions relatively to
TRUSTED|UNTRUSTED create language clause?
CINECA Via Magnanelli 6/3
40033 Casalecchio di Reno (Bologna)
Settore Gestione Sistemi
Francesco Dalla Ca'
Email f.dallaca (AT) cineca (DOT) it
(end of broadcast)
TIP 5: don't forget to increase your free space map settings


No. 1# | By Developer Tags User at [2008-5-4] | size: 560 bytes

"Francesco Dalla Ca'" <f.dallaca (AT) cineca (DOT) itwrites:
Can i create languages functions on a different schema?

You can, but you'd have to modify the createlang program, or do it by
hand using CREATE FUNCTIN and CREATE LANGUAGE. This is just a
restriction of createlang, not any fundamental limitation.

IIRC, we just changed things for 8.1 and up so that the functions are
created in pg_catalog instead of public.

regards, tom lane

(end of broadcast)
TIP 6: explain analyze is your friend



Databases Hot!

Databases New!


Copyright © 2008 www.emsdn.com • All rights reserved • CMS Theme by www.emsdn.com - 0.219