pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: 张元超 <zhangyuanchao@highgo.com>
To: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: One question about callablestatement
Date: Wed, 20 Jan 2016 02:14:48 +0000
Message-ID: <93de5deeabac41d99b0cd910fdfc6c64@EX01.highgo.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

Hi,
    Now ,i found one question about callablestatement.if i have a function whoes name containts '}',and i call it by callablestatement,there will be a 'PSQLException'. Like this:

    org.postgresql.util.PSQLException: Malformed function or procedure escape syntax at offset 19.
at org.postgresql.core.Parser.modifyJdbcCall(Parser.java:644)
at org.postgresql.jdbc2.CachedQueryCreateAction.create(CachedQueryCreateAction.java:40)
at org.postgresql.jdbc2.CachedQueryCreateAction.create(CachedQueryCreateAction.java:21)
at org.postgresql.util.LruCache.borrow(LruCache.java:94)
at org.postgresql.jdbc2.AbstractJdbc2Connection.borrowQuery(AbstractJdbc2Connection.java:106)
at org.postgresql.jdbc2.AbstractJdbc2Statement.<init>(AbstractJdbc2Statement.java:227)
at org.postgresql.jdbc3.AbstractJdbc3Statement.<init>(AbstractJdbc3Statement.java:49)
at org.postgresql.jdbc3g.AbstractJdbc3gStatement.<init>(AbstractJdbc3gStatement.java:29)
at org.postgresql.jdbc4.AbstractJdbc4Statement.<init>(AbstractJdbc4Statement.java:33)
at org.postgresql.jdbc42.AbstractJdbc42Statement.<init>(AbstractJdbc42Statement.java:27)
at org.postgresql.jdbc42.Jdbc42Statement.<init>(Jdbc42Statement.java:31)
at org.postgresql.jdbc42.Jdbc42PreparedStatement.<init>(Jdbc42PreparedStatement.java:21)
at org.postgresql.jdbc42.Jdbc42CallableStatement.<init>(Jdbc42CallableStatement.java:17)
at org.postgresql.jdbc42.Jdbc42Connection.prepareCall(Jdbc42Connection.java:46)
at org.postgresql.jdbc3.AbstractJdbc3Connection.prepareCall(AbstractJdbc3Connection.java:325)
at org.postgresql.jdbc2.AbstractJdbc2Connection.prepareCall(AbstractJdbc2Connection.java:333)

The function name i used is "test_fu}n2".Yeah,i kown that may be nobody will create a function with some name like this,but, it can be created successfully.Ok, i check the code of jdbc,i found some problem lead to the question above. The code file is org/postgresql/core/Parser.java,and row 603 to row 646,the handle of '}' .

I have no idea if it is necessary to modify it.


view thread (3+ messages)  latest in thread

Message-ID: <93de5deeabac41d99b0cd910fdfc6c64@EX01.highgo.com>
Permalink:  ../93de5deeabac41d99b0cd910fdfc6c64@EX01.highgo.com/
Also on:    postgresql.org/message-id/93de5deeabac41d99b0cd910fdfc6c64@EX01.highgo.com

 · 

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: zhangyuanchao@highgo.com
  Subject: Re: One question about callablestatement
  In-Reply-To: <93de5deeabac41d99b0cd910fdfc6c64@EX01.highgo.com>
  References: <93de5deeabac41d99b0cd910fdfc6c64@EX01.highgo.com>

* 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