[Pljava-dev] Pljava-dev Digest, Vol 96, Issue 1

From: marc(dot)r(dot)firth at gmail(dot)com (Marc Firth)
To:
Subject: [Pljava-dev] Pljava-dev Digest, Vol 96, Issue 1
Date: 2012-07-12 13:46:48
Message-ID: CANGTYRPh0U5n24Xmpi0KWOWo1=zvyb1sjipBinOghx4EHs76VA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

On 12/07/2012, pljava-dev-request at pgfoundry.org
<pljava-dev-request at pgfoundry.org> wrote:
> Send Pljava-dev mailing list submissions to
> pljava-dev at pgfoundry.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://pgfoundry.org/mailman/listinfo/pljava-dev
> or, via email, send a message with subject or body 'help' to
> pljava-dev-request at pgfoundry.org
>
> You can reach the person managing the list at
> pljava-dev-owner at pgfoundry.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Pljava-dev digest..."
>
>
> Today's Topics:
>
> 1. Errors with functions that return the "record" SQL data type
> (AGRO AGRO)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 12 Jul 2012 21:22:28 +1030
> From: AGRO AGRO <agro-29 at hotmail.com>
> Subject: [Pljava-dev] Errors with functions that return the "record"
> SQL data type
> To: <pljava-dev at pgfoundry.org>
> Message-ID: <BLU168-W261150ADCDA281E7AF28FAF2D00 at phx.gbl>
> Content-Type: text/plain; charset="iso-8859-1"
>
>
>
>
>
> Hi pljava-dev mailing listers, I have
> recently started using pljava and may be trying to do something it is not
> intended to do. I am using the latest source
> (pljava-src-snapshot.20120525.0.tar.gz) but initially tried with the latest
> precompiled binaries (pljava-x86_64-unknown-linux-gnu-pg8.4-1.4.3.tar.gz)
> and had the same problem. I am trying to write a function that returns
> either a single or set of the SQL data type "record". I have written a java
> class, which implements both the ResultSetProvider and ResultSetHandle
> interfaces and contains the necessary interface methods plus three static
> methods with definitions similar to the following: public static boolean
> complexReturn(ResultSet receiver) throws SQLExceptionpublic static
> ResultSetProvider listComplexTypes() throws SQLExceptionpublic static
> ResultSetHandle listComplexTypesAlternate() I have also defined the
> corresponding functions within my postgres database similar to the followin
> g: CREATE FUNCTION complexReturn()
> RETURNS record
> AS 'myClass.complexReturn' LANGUAGE uJava; CREATE FUNCTION
> listComplexTypes()
> RETURNS SETOF record
> AS 'myClass.listComplexTypes' LANGUAGE uJava; CREATE FUNCTION
> listComplexTypesAlternate()
> RETURNS SETOF record
> AS 'myClass.listComplexTypesAlternate'
> LANGUAGE uJava; I can confirm that that my PostgreSQL functions are in
> fact calling my Java methods and other pljava functions/methods I've written
> that don't use ResultSets/the "record" SQL data type work fine. However, if
> I look at the log files in /var/lib/pgsql/data/pg_log, I can see a call to
> _Composite_getTupleDesc within pljava.so is failing when trying to use any
> of the above functions/methods and I receive the error "An I/O error occured
> while sending to the backend" when calling my SQL functions. If I replace
> the word "record" in each of my SQL function definitions with the name of
> one of my tables i.e. a known record structure, everything works fine. The
> problem with this is that my functions don't return the same column
> structure everytime they're called i.e. I believe this is referred to as
> they return a polymorphic data type, hence why I have specifed return types
> of "record" or "setof record". My question is, is this error caused by a bug
> within pljava or som
> ething wrong with what I'm trying to do? Any advice will be greatly
> appreciated!
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> <http://pgfoundry.org/pipermail/pljava-dev/attachments/20120712/a3482859/attachment-0001.html>
>
> ------------------------------
>
> _______________________________________________
> Pljava-dev mailing list
> Pljava-dev at pgfoundry.org
> http://pgfoundry.org/mailman/listinfo/pljava-dev
>
> End of Pljava-dev Digest, Vol 96, Issue 1
> *****************************************
>

Browse pljava-dev by date

  From Date Subject
Next Message Adam 2012-08-20 01:29:08 [Pljava-dev] Can't figure out: "ERROR: Unable to find static method test.AccessFunctions.echoTest with signature (Ljava/lang/String; )Ljava/lang/String; "
Previous Message AGRO AGRO 2012-07-12 10:52:28 [Pljava-dev] Errors with functions that return the "record" SQL data type