pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedProblem with creating language by JDBC
8+ messages / 4 participants
[nested] [flat]
* Problem with creating language by JDBC
@ 2010-06-24 17:44 Ming Deng <mdeng@rim.com>
2010-06-24 21:38 ` Re: Problem with creating language by JDBC Thomas Kellerer <spam_eater@gmx.net>
0 siblings, 1 reply; 8+ messages in thread
From: Ming Deng @ 2010-06-24 17:44 UTC (permalink / raw)
To: pgsql-jdbc
Hi there,
I was trying to create language by execute() or executeUpdate(). But the
call always fails with message as
problem running SQL query: CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql'
HANDLER plpgsql_call_handler
.An I/O error occured while sending to the backend.
Following is a snippet of the Java code I have, which works with
creating database, executing other queries:
PreparedStatement stmt = null;
ResultSet rs = null;
try {
stmt = con.prepareStatement(str);
System.out.println("Running SQL query: " + str +
"..");
try {
//stmt.executeUpdate();
stmt.execute();
} catch (SQLException sqle) {
StringBuffer errMsg = new StringBuffer(
" problem running SQL
query: " + str + ".");
errMsg.append(sqle.getMessage());
System.err.println(errMsg.toString());
ret = false;
}
con.commit();
System.out.println("Query is done.");
} finally {
I'm using postgresql-8.2dev-501.jdbc3.jar and querying against an 8.3.4
server. If I run the query manually on psql command with same
authentication, it will return successfully. I tried with a later JDBC
driver, it has the same problem.
Regards,
M.
---------------------------------------------------------------------
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Problem with creating language by JDBC
2010-06-24 17:44 Problem with creating language by JDBC Ming Deng <mdeng@rim.com>
@ 2010-06-24 21:38 ` Thomas Kellerer <spam_eater@gmx.net>
2010-06-25 03:10 ` Re: Problem with creating language by JDBC MD <mingdeng2004@gmail.com>
2010-06-26 20:40 ` Re: Problem with creating language by JDBC Lew <noone@lewscanon.com>
0 siblings, 2 replies; 8+ messages in thread
From: Thomas Kellerer @ 2010-06-24 21:38 UTC (permalink / raw)
To: pgsql-jdbc
Ming Deng wrote on 24.06.2010 19:44:
> Hi there,
>
> I was trying to create language by execute() or executeUpdate(). But the
> call always fails with message as
>
> problem running SQL query: CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql'
> HANDLER plpgsql_call_handler
> .An I/O error occured while sending to the backend.
>
> Following is a snippet of the Java code I have, which works with
> creating database, executing other queries:
>
Did you try to use a regular statement, instead of a PreparedStatement?
Statement stmt = con.createStatement()
stmt.executeUpdate("CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql' HANDLER plpgsql_call_handler");
Thomas
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Problem with creating language by JDBC
2010-06-24 17:44 Problem with creating language by JDBC Ming Deng <mdeng@rim.com>
2010-06-24 21:38 ` Re: Problem with creating language by JDBC Thomas Kellerer <spam_eater@gmx.net>
@ 2010-06-25 03:10 ` MD <mingdeng2004@gmail.com>
2010-06-25 06:40 ` Re: Problem with creating language by JDBC Thomas Kellerer <spam_eater@gmx.net>
1 sibling, 1 reply; 8+ messages in thread
From: MD @ 2010-06-25 03:10 UTC (permalink / raw)
To: pgsql-jdbc; +Cc: Thomas Kellerer <spam_eater@gmx.net>
On Jun 24, 5:38 pm, spam_eater@gmx.net (Thomas Kellerer) wrote:
> Ming Deng wrote on 24.06.2010 19:44:
>
> > Hi there,
>
> > I was trying to create language by execute() or executeUpdate(). But the
> > call always fails with message as
>
> > problem running SQL query: CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql'
> > HANDLER plpgsql_call_handler
> > .An I/O error occured while sending to the backend.
>
> > Following is a snippet of the Java code I have, which works with
> > creating database, executing other queries:
>
> Did you try to use a regular statement, instead of a PreparedStatement?
>
> Statement stmt = con.createStatement()
> stmt.executeUpdate("CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql' HANDLER plpgsql_call_handler");
>
> Thomas
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
> To make changes to your subscription:http://www.postgresql.org/mailpref/pgsql-jdbc
I just tried with the regular statement, got the same failure.
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Problem with creating language by JDBC
2010-06-24 17:44 Problem with creating language by JDBC Ming Deng <mdeng@rim.com>
2010-06-24 21:38 ` Re: Problem with creating language by JDBC Thomas Kellerer <spam_eater@gmx.net>
2010-06-25 03:10 ` Re: Problem with creating language by JDBC MD <mingdeng2004@gmail.com>
@ 2010-06-25 06:40 ` Thomas Kellerer <spam_eater@gmx.net>
2010-06-25 14:00 ` Re: Problem with creating language by JDBC MD <mingdeng2004@gmail.com>
0 siblings, 1 reply; 8+ messages in thread
From: Thomas Kellerer @ 2010-06-25 06:40 UTC (permalink / raw)
To: pgsql-jdbc
MD, 25.06.2010 05:10:
>>> I was trying to create language by execute() or executeUpdate(). But the
>>> call always fails with message as
>>
>>> problem running SQL query: CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql'
>>> HANDLER plpgsql_call_handler
>>> .An I/O error occured while sending to the backend.
>>
>>> Following is a snippet of the Java code I have, which works with
>>> creating database, executing other queries:
>>
>> Did you try to use a regular statement, instead of a PreparedStatement?
>>
>
> I just tried with the regular statement, got the same failure.
That's strange, the following works fine for me:
Class.forName("org.postgresql.Driver");
con = DriverManager.getConnection("jdbc:postgresql://localhost/postgres", "postgres", "postgres");
stmt = con.createStatement();
stmt.executeUpdate("CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql' HANDLER plpgsql_call_handler");
I think it is not related to the way you run this from Java, but something else, and the "I/O error" seems to indicate that.
Regards
Thomas
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Problem with creating language by JDBC
2010-06-24 17:44 Problem with creating language by JDBC Ming Deng <mdeng@rim.com>
2010-06-24 21:38 ` Re: Problem with creating language by JDBC Thomas Kellerer <spam_eater@gmx.net>
2010-06-25 03:10 ` Re: Problem with creating language by JDBC MD <mingdeng2004@gmail.com>
2010-06-25 06:40 ` Re: Problem with creating language by JDBC Thomas Kellerer <spam_eater@gmx.net>
@ 2010-06-25 14:00 ` MD <mingdeng2004@gmail.com>
2010-06-25 15:14 ` Re: Problem with creating language by JDBC Thomas Kellerer <spam_eater@gmx.net>
0 siblings, 1 reply; 8+ messages in thread
From: MD @ 2010-06-25 14:00 UTC (permalink / raw)
To: pgsql-jdbc
On Jun 25, 2:40 am, spam_ea...@gmx.net (Thomas Kellerer) wrote:
> MD, 25.06.2010 05:10:
>
> >>> I was trying to create language by execute() or executeUpdate(). But the
> >>> call always fails with message as
>
> >>> problem running SQL query: CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql'
> >>> HANDLER plpgsql_call_handler
> >>> .An I/O error occured while sending to the backend.
>
> >>> Following is a snippet of the Java code I have, which works with
> >>> creating database, executing other queries:
>
> >> Did you try to use a regular statement, instead of a PreparedStatement?
>
> > I just tried with the regular statement, got the same failure.
>
> That's strange, the following works fine for me:
>
> Class.forName("org.postgresql.Driver");
> con = DriverManager.getConnection("jdbc:postgresql://localhost/postgres", "postgres", "postgres");
> stmt = con.createStatement();
> stmt.executeUpdate("CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql' HANDLER plpgsql_call_handler");
>
> I think it is not related to the way you run this from Java, but something else, and the "I/O error" seems to indicate that.
>
> Regards
> Thomas
Hi Thomas,
Thanks for your investigation. What are the version of Postgres and
JDBC you are using?
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Problem with creating language by JDBC
2010-06-24 17:44 Problem with creating language by JDBC Ming Deng <mdeng@rim.com>
2010-06-24 21:38 ` Re: Problem with creating language by JDBC Thomas Kellerer <spam_eater@gmx.net>
2010-06-25 03:10 ` Re: Problem with creating language by JDBC MD <mingdeng2004@gmail.com>
2010-06-25 06:40 ` Re: Problem with creating language by JDBC Thomas Kellerer <spam_eater@gmx.net>
2010-06-25 14:00 ` Re: Problem with creating language by JDBC MD <mingdeng2004@gmail.com>
@ 2010-06-25 15:14 ` Thomas Kellerer <spam_eater@gmx.net>
2010-06-25 20:28 ` Re: Problem with creating language by JDBC MD <mingdeng2004@gmail.com>
0 siblings, 1 reply; 8+ messages in thread
From: Thomas Kellerer @ 2010-06-25 15:14 UTC (permalink / raw)
To: pgsql-jdbc
>> Class.forName("org.postgresql.Driver");
>> con = DriverManager.getConnection("jdbc:postgresql://localhost/postgres", "postgres", "postgres");
>> stmt = con.createStatement();
>> stmt.executeUpdate("CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql' HANDLER plpgsql_call_handler");
>>
>> I think it is not related to the way you run this from Java, but something else, and the "I/O error" seems to indicate that.
>>
>> Regards
>> Thomas
>
> Hi Thomas,
>
> Thanks for your investigation. What are the version of Postgres and
> JDBC you are using?
>
Postgres: 8.4.2
JDBC Driver: 8.4 JDBC4 (build 701)
Regards
Thomas
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Problem with creating language by JDBC
2010-06-24 17:44 Problem with creating language by JDBC Ming Deng <mdeng@rim.com>
2010-06-24 21:38 ` Re: Problem with creating language by JDBC Thomas Kellerer <spam_eater@gmx.net>
2010-06-25 03:10 ` Re: Problem with creating language by JDBC MD <mingdeng2004@gmail.com>
2010-06-25 06:40 ` Re: Problem with creating language by JDBC Thomas Kellerer <spam_eater@gmx.net>
2010-06-25 14:00 ` Re: Problem with creating language by JDBC MD <mingdeng2004@gmail.com>
2010-06-25 15:14 ` Re: Problem with creating language by JDBC Thomas Kellerer <spam_eater@gmx.net>
@ 2010-06-25 20:28 ` MD <mingdeng2004@gmail.com>
0 siblings, 0 replies; 8+ messages in thread
From: MD @ 2010-06-25 20:28 UTC (permalink / raw)
To: pgsql-jdbc
On Jun 25, 11:14 am, spam_ea...@gmx.net (Thomas Kellerer) wrote:
> >> Class.forName("org.postgresql.Driver");
> >> con = DriverManager.getConnection("jdbc:postgresql://localhost/postgres", "postgres", "postgres");
> >> stmt = con.createStatement();
> >> stmt.executeUpdate("CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql' HANDLER plpgsql_call_handler");
>
> >> I think it is not related to the way you run this from Java, but something else, and the "I/O error" seems to indicate that.
>
> >> Regards
> >> Thomas
>
> > Hi Thomas,
>
> > Thanks for your investigation. What are the version of Postgres and
> > JDBC you are using?
>
> Postgres: 8.4.2
> JDBC Driver: 8.4 JDBC4 (build 701)
>
> Regards
> Thomas
>
Thanks very much for your info. With the help of that, I narrowed down
the problem. It was caused by a bug in a related piece of code.
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Problem with creating language by JDBC
2010-06-24 17:44 Problem with creating language by JDBC Ming Deng <mdeng@rim.com>
2010-06-24 21:38 ` Re: Problem with creating language by JDBC Thomas Kellerer <spam_eater@gmx.net>
@ 2010-06-26 20:40 ` Lew <noone@lewscanon.com>
1 sibling, 0 replies; 8+ messages in thread
From: Lew @ 2010-06-26 20:40 UTC (permalink / raw)
To: pgsql-jdbc
Thomas Kellerer wrote:
> Did you try to use a regular statement, instead of a PreparedStatement?
That would not change anything.
--
Lew
^ permalink raw reply [nested|flat] 8+ messages in thread
end of thread, other threads:[~2010-06-26 20:40 UTC | newest]
Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-06-24 17:44 Problem with creating language by JDBC Ming Deng <mdeng@rim.com>
2010-06-24 21:38 ` Thomas Kellerer <spam_eater@gmx.net>
2010-06-25 03:10 ` MD <mingdeng2004@gmail.com>
2010-06-25 06:40 ` Thomas Kellerer <spam_eater@gmx.net>
2010-06-25 14:00 ` MD <mingdeng2004@gmail.com>
2010-06-25 15:14 ` Thomas Kellerer <spam_eater@gmx.net>
2010-06-25 20:28 ` MD <mingdeng2004@gmail.com>
2010-06-26 20:40 ` Lew <noone@lewscanon.com>
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