From: Fichtenelch <hillebra@inf.fu-berlin.de>
To: pgsql-jdbc@postgresql.org
Subject: Exception using dollar-quoted string
Date: Fri, 24 Mar 2006 17:39:33 +0100
Message-ID: <000201c64f61$88342aa0$1530a8c0@hgworkstation0> (raw)
Hi,
when I'm trying to execute the following command with a java.sql.Statement
an error occurs:
CREATE OR REPLACE FUNCTION test(text) RETURNS void AS $$ DECLARE tmp text;
BEGIN tmp := 'test'; END; $$ LANGUAGE plpgsql;
org.postgresql.util.PSQLException: ERROR: unterminated dollar-quoted string
at or near "$$ DECLARE tmp text"
at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorI
mpl.java:1512)
at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.ja
va:1297)
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.j
ava:437)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2St
atement.java:339)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.j
ava:331)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.postgresql.ds.common.PooledConnectionImpl$StatementHandler.invoke(Pooled
ConnectionImpl.java:467)
at $Proxy2.execute(Unknown Source)
The command: CREATE OR REPLACE FUNCTION test(text) RETURNS void AS ' DECLARE
tmp text; BEGIN tmp := "test"; END; ' LANGUAGE plpgsql;
works fine, also creating the function with php (phppgadmin). I have the
latest version of the jdbc driver.
Is this a bug, or my fault?
Thanks,
Fichtenelch
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: hillebra@inf.fu-berlin.de
Subject: Re: Exception using dollar-quoted string
In-Reply-To: <000201c64f61$88342aa0$1530a8c0@hgworkstation0>
References: <000201c64f61$88342aa0$1530a8c0@hgworkstation0>
* 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