agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
Subject: [Pljava-dev] CREATE FUNCTION docs inconsistent with implementation
Date: Tue, 08 Aug 2006 19:39:35 -0400
Message-ID: <44D920B7.4020509@goldencode.com> (raw)

In case anyone else has been having trouble with this, hopefully this
will save you some time...

The "Function mapping" (long-form) CREATE FUNCTION sample from the Wiki
seems to be out of sync with the backing implementation:

CREATE FUNCTION getsysprop(VARCHAR)
  RETURNS VARCHAR
  AS 'java.lang.String java.lang.System.getProperty(java.lang.String)'
  LANGUAGE java;

When getsysprop is run as is, the Java class name is interpreted as
'java.lang.Stringjava.lang.System' and the return type as 'null', as in:

DEBUG:  className = 'java.lang.Stringjava.lang.System', methodName =
'getProperty', parameters = 'java.lang.String', returnType = 'null'
DEBUG:  Loading class java.lang.Stringjava.lang.System
ERROR:  java.lang.ClassNotFoundException: java.lang.Stringjava.lang.System

The parseFunction function (line 387 in src/C/pljava/Functions.c from
the 1.3.0 source download) looks for '=' between the return type and
class name.  Consequently, the CREATE FUNCTION statement must be:

CREATE FUNCTION getsysprop(VARCHAR)
  RETURNS VARCHAR
  AS 'java.lang.String=java.lang.System.getProperty(java.lang.String)'
  LANGUAGE java;

Is the '=' delimiter expected to be a permanent syntax here, or is the
intention that the implementation eventually will match the docs?

Thanks,
Eric Faulhaber





view thread (2+ messages)  latest in thread

Message-ID: <44D920B7.4020509@goldencode.com>
Permalink:  ../44D920B7.4020509@goldencode.com/
Also on:    postgresql.org/message-id/44D920B7.4020509@goldencode.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pljava-dev@postgresql.org
  Subject: Re: [Pljava-dev] CREATE FUNCTION docs inconsistent with implementation
  In-Reply-To: <44D920B7.4020509@goldencode.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox