From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-jdbc@postgresql.org
Subject: Re: Slow performance updating CLOB data
Date: Mon, 18 Jul 2016 10:43:32 +0200
Message-ID: <nmi4rk$ki0$1@ger.gmane.org> (raw)
In-Reply-To: <47856758BAE4794A9EC4FCA2E63FC85E370593D0@exchange.intranet.efsw.it>
References: <47856758BAE4794A9EC4FCA2E63FC85E37059326@exchange.intranet.efsw.it>
<47856758BAE4794A9EC4FCA2E63FC85E370593D0@exchange.intranet.efsw.it>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>
Nicola Zanaga schrieb am 18.07.2016 um 10:13:
> Here a snippet:
>
> st= connection.createStatement(ResultSet.*/TYPE_FORWARD_ONLY/*, ResultSet.*/CONCUR_UPDATABLE/*);
> ResultSet resultSet= st.executeQuery("SELECT id, data FROM TestClob1 WHERE id = 1 ");
>
>
> resultSet.next();
> resultSet.updateCharacterStream(2, *new*StringReader("hello"), "hello".length());
> resultSet.updateRow();
> resultSet.close();
Did you try resultSet.updateString(2, "hello") instead?
> Most of the time is spent in method PgResultSet.isUpdateable because the table has a primary key but doesn't have a "oid" column.
> So the code tries to get primary keys from the query, using getMetaData().getPrimaryKeys.
But in order to run an UPDATE on the table, the driver will need to retrieve the PK, there is no way around that.
I guess using updateString() won't change that
Thomas
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
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: Slow performance updating CLOB data
In-Reply-To: <nmi4rk$ki0$1@ger.gmane.org>
References: <47856758BAE4794A9EC4FCA2E63FC85E37059326@exchange.intranet.efsw.it> <47856758BAE4794A9EC4FCA2E63FC85E370593D0@exchange.intranet.efsw.it> <nmi4rk$ki0$1@ger.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