pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-jdbc@postgresql.org
Subject: CREATE FUNCTION with JDBC
Date: Mon, 23 May 2005 23:48:07 +0200
Message-ID: <d6tivq$n9$1@sea.gmane.org> (raw)

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






view thread (3+ messages)  latest in thread

Message-ID: <d6tivq$n9$1@sea.gmane.org>
Permalink:  ../d6tivq$n9$1@sea.gmane.org/
Also on:    postgresql.org/message-id/d6tivq$n9$1@sea.gmane.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: spam_eater@gmx.net
  Subject: Re: CREATE FUNCTION with JDBC
  In-Reply-To: <d6tivq$n9$1@sea.gmane.org>
  References: <d6tivq$n9$1@sea.gmane.org>

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

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