X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 958D652867 for ; Mon, 23 May 2005 18:51:19 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 22524-03 for ; Mon, 23 May 2005 21:51:10 +0000 (GMT) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by svr1.postgresql.org (Postfix) with ESMTP id 1AB645285F for ; Mon, 23 May 2005 18:51:09 -0300 (ADT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1DaKmV-0000aO-9K for pgsql-jdbc@postgresql.org; Mon, 23 May 2005 23:48:15 +0200 Received: from ppp-82-135-77-110.mnet-online.de ([82.135.77.110]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 23 May 2005 23:48:15 +0200 Received: from spam_eater by ppp-82-135-77-110.mnet-online.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 23 May 2005 23:48:15 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Thomas Kellerer Subject: CREATE FUNCTION with JDBC Date: Mon, 23 May 2005 23:48:07 +0200 Lines: 34 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: ppp-82-135-77-110.mnet-online.de User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:1.7.6) Gecko/20050319 Mnenhy/0.6.0.104 X-Accept-Language: de, en X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200505/91 X-Sequence-Number: 12922 Hello, I was using a Java based front end to PG and tried to create a function that I could use for a trigger. CREATE OR REPLACE FUNCTION trg_func_ucase() RETURNS trigger AS $trg$ BEGIN NEW.name = upper(NEW.name); END; $trg$ language 'plpgsql'; I kept getting an error message ERROR: unterminated dollar-quoted string at or near "$trg$ As the statement works with psql, I thought this might be a problem of my JDBC frontend, so I create a simple test program which sends the above string using execute() (tried executeUpdate() as well) to the database, and I'm getting the same error. When I use single quotes around the function body everything works fine through plain JDBC. This means a use disadvantage for any Java based frontend (as I have to deal with the old clumsy quoting again), and I'm wondering if this is a bug in the driver, or simply not supposed to work. In any case: is there any chance of getting this fixed? I'm using PG 8.0.2 on Win2000 and the JDBC driver is 8.0-311 Cheers Thomas