|PostgreSQL Reference Manual - Volume 2 - Programming Guide|
by The PostgreSQL Global Development Group
Paperback (6"x9"), 408 pages
RRP £19.95 ($34.95)
Sales of this book support the PostgreSQL project! Get a printed copy>>>
10.7 Modules and the unknown command
PL/Tcl has support for autoloading Tcl code when used.
It recognizes a special table,
is presumed to contain modules of Tcl code. If this table
exists, the module
unknown is fetched from the table
and loaded into the Tcl interpreter immediately after creating
unknown module could actually contain any
initialization script you need, it normally defines a Tcl
unknown procedure that is invoked whenever Tcl does
not recognize an invoked procedure name. PL/Tcl's standard version
of this procedure tries to find a module in
that will define the required procedure. If one is found, it is
loaded into the interpreter, and then execution is allowed to
proceed with the originally attempted procedure call. A
pltcl_modfuncs provides an index of
which functions are defined by which modules, so that the lookup
is reasonably quick.
The PostgreSQL distribution includes
support scripts to maintain these tables:
pltcl_delmod, as well as source for the standard
unknown module in ‘share/unknown.pltcl’. This module
must be loaded
into each database initially to support the autoloading mechanism.
must be readable by all, but it is wise to make them owned and
writable only by the database administrator.
|ISBN 0954612035||PostgreSQL Reference Manual - Volume 2 - Programming Guide||See the print edition|