On Thu, Jun 27, 2002 at 09:44:08AM +0100, Alison Stevenson wrote:
> Firstly, am I correct in thinking that user-defined functions cannot
> be written in C++ or Java? (The FAQ gives C, SQL, PL/pgSQL, Tcl,
> Perl, Python, or Ruby as the only possibilities)
UDFs can be written in Java using http://pljava.sf.net.
You can write UDFs in C++ -- as long as the single function you tell
Postgres about (the "entry point" into the C++ code) is defined with C
linkage (extern "C" { ... }).
> Secondly what sort of SQL interface to the user defined functions
> is available? For example if I defined a 'distance' function to
> compare two feature_vectors stored as BLOBs can I call
> t1.feature_vector.distance(t2.feature_vector)
No -- you can call distance(t1.feature_vector, t2.feature_vector)
though.
Cheers,
Neil
--
Neil Conway <neilconway@rogers.com>
PGP Key ID: DB3C29FC