Thread: sharing tcl proc's between functions

sharing tcl proc's between functions

From
"Bob Parkinson"
Date:
Hi,

Is it possible to share some TCL proc's between a set of functions? Something like

proc mything {
}

proc otherthing {
}


create function wantsthings (text)  returns text as
'
  return [mything [otherthing fubar]]

' language 'pltcl';

Cheers,










Bob



This message has been scanned but we cannot guarantee that it and any
attachments are free from viruses or other damaging content: you are
advised to perform your own checks.  Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.


Re: sharing tcl proc's between functions

From
Tom Lane
Date:
"Bob Parkinson" <rwp@biome.ac.uk> writes:
> Is it possible to share some TCL proc's between a set of functions?

Sure.  IIRC all pltcl functions run in a backend share one interpreter
(and pltclu functions share a second one).  You might look at the
"pltcl_modules" code as a convenient way of getting things loaded upon
first use:
http://www.postgresql.org/docs/7.4/static/pltcl-unknown.html

            regards, tom lane