Skip site navigation (1) Skip section navigation (2)

BUG #2414: Something is missing in the PostGre-Java-Connector

From: "Michael" <michael(dot)rueckert(at)thethirddimension(dot)de>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2414: Something is missing in the PostGre-Java-Connector
Date: 2006-04-29 14:02:01
Message-ID: 200604291402.k3TE21jT004662@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      2414
Logged by:          Michael
Email address:      michael(dot)rueckert(at)thethirddimension(dot)de
PostgreSQL version: 8.1
Operating system:   Windows XP Pro SP2
Description:        Something is missing in the PostGre-Java-Connector
Details: 

Hi,

I'd found PostgreSQL for creating my private software programs. I'am using
the P.-SQL Database in many of my java programs and I think i have found a
bug in your PostgreSQL-Java-Connector.
I will try to describe my problem as best as I can:

In my software I'm using some triggers and I have programmed a tool that
reads my own SQL-Script for creating the database tables, functions...
But when I try to execute the creation of a trigger there occurs an error.
That's an example of the script, that I have created (the following will not
work, but the originally sql-statement does, when I execute it with the
PostgreSQL-Administrator-Tool):

CREATE FUNCTION exampleFunction() RETURNS trigger AS $$
DECLARE
BEGIN
   DELETE FROM exTable1 WHERE (exT1_pk = 1);
   DELETE FROM exTabel2 WHERE (exT2_pk = 2);

   RETURN anything;
END;
$$ LANGUAGE plpgsql;

So I think the problem is that the connector only reads the statement until
the next semicolon after the delete-statement, which is part of the function
and not until the next semicolon after the "$$".
Like I already said, the statement works fine when it is executed with the
administrator, but not when this statement is executed with the connector.
The connector gives an error if it is executed:
org.postgresql.util.PSQLException: ERROR: unterminated dollar-quoted string
at or near "$$
DECLARE
BEGIN
   DELETE FROM exTable1 WHERE (exT1_pk = 1)"

So, as you can see in the first example the function is terminated, but
because of the semicolon after the first delete-statement the connector
"thinks" the statement is complete...but it isn't.

Maybe you can fix it? Would be great!


Sincerely,
Michael

pgsql-bugs by date

Next:From: Stephan SzaboDate: 2006-04-29 15:42:48
Subject: Re: BUG #2412: Foreing key accept nulls
Previous:From: PlatonovDate: 2006-04-28 07:55:50
Subject: BUG #2413: connection refused 0274D/10061

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group