Packaging of 9.2-1001 source tarball

I find that postgresql-jdbc-9.2-1001.src.tar.gz doesn't contain a
version-numbered top-level directory --- unpacking it just litters
your current directory with a bunch of files. I hope this is a
mistake and not new packaging policy.

regards, tom lane

Re: [JDBC] Website Todo List

The TODO list still has value.

Website Todo List

Is the website todo list up to date?

<a href="" title=""></a>


does the JDBC driver offer a similar property to the ODBC Text As LongVarchar?

In the Postgres ODBC driver you can confirm Data Type Options:Text as
LongVarChar = True and set Max properties for Varchar and LongVarChar.

I did not see if the JDBC driver is providing similar options in the recent
9.x drivers.

As-is, Postgres likes to describe the precision on character expressions as
text 2147483647 which may make sense if the business data was to be a CLOB.
But an application that is using the precision for other purposes will
dislike the value. Hence, with ODBC you could change the way data was

Error while returning auto-generated values

I'm trying to execute an insert statement against the following table, in
which subscriber_id is auto incremented.

subscriber_id | user_id | tenant_id | email_address | date_subscribed
1 | admin1234 | -1234 | | 1970-01-01
3 | admin12345 | -1234 | | 1970-01-01

Table was created using the following statement:

SUBSCRIBER_ID INTEGER DEFAULT nextval('am_subscriber_sequence'),

Possible bug / regression from generated keys

I'm getting an exception from the ResultSet returned from
getGeneratedKey() from a batch insert PreparedStatement. When I use
any of the postgresql-9.2-100X.jdbc4.jar drivers I get exceptions, but
when I use postgresql-9.1-902.jdbc4.jar it works.

Has anyone seen anything like this? How can I debug this problem

Buildfarm test failure

The buildfarm failed last night whilst performing the JDK 5 builds:

[mkdir] Created dir: /home/ubuntu/buildarea/HEAD/pgjdbc/build/tests
[javac] /home/ubuntu/buildarea/HEAD/pgjdbc/build.xml:399: warning:
'includeantruntime' was not set, defaulting to build.sysclasspath=last;
set to false for repeatable builds
[javac] Compiling 58 source files to
cannot find symbol
[javac] symbol : method

Misspelling in error message


Wanted to report a misspelling of a word on the error message which I got.

Driver version: postgresql-9.1-901.jdbc4.jar
Server: 9.1.6
Error: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend
Description: Reporting misspelling of the word 'occurred'.

Thank you.


git gururs

I am trying to figure out a rational workflow with the branches here.

I have cloned the project to my own repo so if I want add a patch my
current workflow is

1) pull from the real jdbc remote repo to make sure everything is up to date
2) push to my remote to update my remote
3) create a new branch to work on
4) modify code, test commit to my new branch
5) checkout master
6) merge with new branch
7) push to my remote

Now here's where I've run into trouble.

Can I just push to the real jdbc remote ?

Next how to backpatch.

just checking out REL9_2_STABLE and merging my new branch doesn't wo

Please public the latest drivers to Maven Central

The latest version available in Maven Central is 9.1-901 (see link
below). Please publish the current versions to Maven Central.

<a href="" title=""></a>

Daniel Serodio


Whay this is default
public String getTableName(int column) throws SQLException
return "";

and not this
public String getTableName(int column) throws SQLException
return getBaseTableName(column);

Small bug: In 9.2-1000, PreparedStatement.toString shows byte[].toString for int types

Low priority (for me at least), but the PreparedStatement.toString for
the most recent version of the driver looks funny when it prints a
prepared statement that has an Int parameter.

JDBC4 Postgresql Driver

Hello PostgreSQL Global Development Group:

I'm in process of determining an export control tag (ECCN) for JDBC4.
I'd appreciate if you could answer the below questions.

How is JDBC4 different from PostgreSQL, psqlODBC?

Does JDBC4 contain embedded encryption, or special software technology?

Thank you.

Laura M. Boyer
IT Leader SYS, SW, HW & Test Engineering Tools - GE Aviation Systems

T - (616) 241-7702
M - (616) 204-2952
F - (616) 619-5963
<a href="mailto:laura. ... at ge dot com">laura. ... at ge dot com</a>

3290 Patterson Avenue SE, MS 1B3
Grand Rapids, MI 49512-1991, U.S.A.

Re: [JDBC] commit problem

Now you've piqued my interest. To run multiple simple selects which
should see a consistent view of the data, wouldn't they expect they
could setTransactionIsolation() to TRANSACTION_REPEATABLE_READ or
TRANSACTION_SERIALIZABLE and setAutoCommit() false to see a stable
view of the data?  How would they say they were done with that view
and wanted a fresh one for the next batch of SELECT statements?


Re: [JDBC] commit problem

John R Pierce wrote:

Re: [JDBC] commit problem

Which is what seems to be required by the API:

<a href="" title=""></a>

Or rather, whatever it wants, regardless of standards and API
definitions. An API currently published by...

commit problem

my Java developers are telling me, the recent JDBC drivers are throwing
an exception if they inadvertantly issue a commit() on an autocommit
connection. this is causing a bunch of problems for us, we have a
huge code base of java jdbc software which was originally written for
Oracle, and it assumes that read only operations are NOT starting a
transaction block (apparently Oracle only starts a transaction block on
DML like insert/update/delete/select for update/etc.).

Re: [JDBC] 9.1-903 JDBC 3 Download

In light of this information do you still wish help in pursing a EC2 instance
build of the JDBC JARs for the web site?

<a href="" title=""></a>


Re: [JDBC] test will not be finished when i using 200 client threads

You didn't say anything about your hardware or OS.  For that to be a
somewhat reasonable configuration you would need to be running on
Windows with about 1TB of RAM and about 70 disk spindles. If your
runtime environment doesn't look like that, you need to make some

Publish artifacts to Maven central


I would like to help get the jdbc driver jars uploaded to Maven central
automatically. I have found a set of Maven Ant tasks that will do the job (
<a href="" title=""></a>) and shouldn't disrupt the
current Ant script much - except for an additional third party jar
containing the tasks, and the changes to create the required jars.

Would it be useful to the project for me to work on this?

Many thanks,

test will not be finished when i using 200 client threads

Hello all,

I am trying to test postgresql using YCSB, and when i set client thread as
200, i found it will not be finished.
and log likes

-bash-3.2$ vi postgresql-Sun.log
LOG: database system was shut down at 2012-10-21 21:32:52 KST
LOG: database system is ready to accept connections
LOG: autovacuum launcher started

My key configuration in postgresql.conf

listen_addresses = '*'
max_connections = 400
shared_buffers = 512MB
temp_buffers = 200MB
work_mem = 1GB
maintenance_work_mem = 512MB

do you know why?

Struct Support

Hi Dave,
 I am in process of implementing java.sql.Struct to support composite types as OUT/IN parameters in postgres JDBC Driver. I am almost done with that, but while writing test cases, I came across an issue with return values. The Struct parameters are successfully being passed and returned as OUT parameters (I have tested that with multiple out and in parameters of type Struct as well). But when it comes to returning a struct value, server returns two fields in RowDescription which makes driver believe that these are actually two parameters.

9.1-903 JDBC 3 Download

Today I downloaded the postgresql-9.1-903.jdbc3.jar from the website,
<a href="" title=""></a>.

PGCopyOutputStream Doesn't Hold Connection

Something that might be worth noting (in documentation?) is that the PGCopyOutputStream class doesn't hold a reference to its Connection.

We came across this because we were trying to keep our DB code separate from the logic, and we started getting errors writing to the PGCopyOutputStream.

Parameters are not being setted in a copy statement

Hi all

We need to copy from an arbitray query to a csv. We are using Postgresql
9.1 an we would use the copy statement
We need to trigger this query from a java application.

New participator in JDBC driver developing

Hello everybody:
I am a new developer here to participating in JDBC driver
development,and what I want to ask is the positon of the TODO list we
have,and what can I do for our JDBC driver.
I will make my best contribution to this JDBC driver.And let learn
from each other.

Rugal Bernstein

ResultSetMetaData.isNullable(i) and outer joined columns


I've just noticed that ResultSetMetaData.isNullable(i) in the PostgreSQL JDBC driver doesn't reflect whether fields of result set column i may be null, but the nullability of the table column it's selected from. These may differ for result set columns that originate from a outer joined table, in which case fields may of course be null even if the source table column is not nullable, but in such cases isNullable still indicates the column is not nullable.

large object max size

What is the maximum size of large object supported by the latest JDBC
driver ?


drop in performance using jdbc driver version 9


We have been using postgreSQL for several years and we have just upgraded the jdbc driver (along with the db server) to version 9. As a result, we are getting poor performance with the new configuration: operations that took about 10 seconds using postgresql-8.4-701.jdbc4.jar take more than 2 minutes now.

To be more accurate, our application relies on some kind of init function that uses select queries involving metadata and ordinary data.
1. This operation takes about 12 seconds when our application is running with postgresql-8.4-701.jdbc4.jar.

Minor flaw: 9.2 driver identifies itself as "devel"

The driver "postgresql-9.2-1000.jdbc4.jar" returns

PostgreSQL 9.2devel JDBC4 (build 1000)

as its version number when using DatabaseMetaData.getDriverVersion().

Previous release versions did not contain "devel" in their version information.


getMetaData().getUserName() implementation


I have been using Apache Derby as data base backend for an application
over the past years and am looking into adding PostgreSQL as an
additional backend the application could be run against.
Obviously all stored procedure code I have written is in Java.

Severe performance degradation when using the 9.2-1000 JDBC 4 driver


after the upgrade the latest PortgreSQL 9.2-1000 JDBC 4 driver, we
discovered a severe performance degradation when connecting to 8.4,
9.0, 9.1, and 9.2 servers. In a test application the
DriverManager#getConnection(String, String, String) call constantly
took > 4500 ms compared to < 20 ms with the previous 9.1-903 JDBC 4
driver. This makes the driver virtually unusable in production

Client: Windows 2008 R2, Windows 7
Server: PostgreSQL 8.4, 9.0, 9.1, 9.2 on Linux 2.6


bug report: slow getColumnTypeName

ResultSetMetaData __md = __rs.getMetaData(); //this
is fine
String __sf1name = __md.getColumnName(1); //this
is fine
int __if1type = __md.getColumnType(1);
//this is fine
String __sf1type = __md.getColumnTypeName(1); //this is
SLOW!! ~15msec

postgres server version is 9.1.5
jdbc version, i checked both 9.1-901 and 9.1-903
and... BTW, 9.0-801 works good (while connected pg9.1)!

"Select * " on 12-18M row table from remote machine thru JDBC - Performance nose-dives after 10M-ish records

On machine 1 - a table that contains between 12 and 18 million rows
On machine 2 - a Java app that calls Select * on the table, and writes it
into a Lucene index

Originally had a fetchSize of 10,000 and would take around 38 minutes for 12
million, 50 minutes for 16ish million to read it all & write it all back out
as the lucene index

One day it started taking 4 hours.

isValid availability


The method isValid is implemented and committed since 2012-01-19 by
Dave Cramer, however, it isn't available on the driver version 901 and

Any reason why?

On the same subject, the implementation is using SELECT 1; because it
was the simplest query returning a value, simply issuing an "" won't
guarantee to go to the back-end (it may go for now, but it depends on
the driver bottom layer to issue it to the back-end.

Not able to insert array of integers into column of type integer array


I am trying to insert a row to a column in a table which is of data type
INT4[]. I am not sure what should be the code in java I should write so that
I can write the insert query.

data set combination of integer and decimal/numeric returns wrong result type

decimal/numeric (7,2)

select tint.cint from tint union select tdec.cdec from tdec

no precision is returned as expected etc
display size is odd

getTableNamegetSchemaName getCatalogNamegetColumnClassName
isCaseSensitiveisCurrencyisDefinitelyWritable isReadOnlyisSearchableisSigned
isWritable 1cintnumeric002 java.math.BigDecimal131089cint2falsefalsefalse

data type of projected item in a union not correct

Database 9.0.4
Driver PostgreSQL 9.1 JDBC4 (build 902)

The following projection is not described with the expected type+precision
as one would expect from ISO-SQL

Is this a known Postgres bug, quirk or ....

t1.c1 char(32)
t2.c1 varchar(32)

select t1.c1 returns precision of 32
select t2.c1 returned precision of 32



returns precision 2147483647

When will your JDBC 4.0 driver implement DatabaseMetadata.getFunctions?

Currently fails

PostgreSQL 9.1 JDBC4 (build 902)

Error calling JDBC driver for procedure metadata.
SQLException.sqlState(0A000) SQLException.Message(Method
org.postgresql.jdbc4.Jdbc4DatabaseMetaData.getFunction(String, String,
String) is not yet implemented.)

ResultSet metadata for a prepared statement missing the applicable table, schema etc properties

If you create a PreparedStatement such as select c1 from t1 and
subsequently request the ResultSetMetadata for that statement you will
observe that the driver is not providing any values for getTableName,
getSchemaName etc.

Is this a known bug?

Driver PostgreSQL 9.1 JDBC4 (build 902)
Server 9.0.4

DatabaseMetadata.getTypeInfo resultset returns more than just Postgres/user defined data types

The result set returned from DatabaseMetadata.getTypeInfo contains many
rows for instance it returns entries for tables and views in schemas.

This seems inconsistent with the 'spirit' of what this method is intended
to facilitiate.

Is this a known Postgres JDBC driver bug?

<a href="" title=""></a>

JDBC Build farm now using Git!

I made the modifications to my build farm member last night so that it now
pulls the JDBC source code from Git. I've also dropped JDKs 1.4 & 1.5 from
the list and added 1.7 with 1.6 remaining. Branches 8.4, 9.2 and HEAD were
built and tested with everything passing. The current status of the build
farm can be viewed here:
<a href="" title=""></a>

You'll note that HEAD hasn't registered a success in 3 days. The reason
for this is it takes too long to build and run all the tests.

Bug in AbstracJdbc2Statement.replaceProcessing when using dollar quoting?

I think there is a bug in AbstracJdbc2Statement.replaceProcessing. When I am trying to execute the following sql command with a java.sql.Statement the data written to the database is not what it should be:

INSERT INTO dev.stringtest (id, val) VALUES (1, $a$ {a}{f} {b} {f}$a$)

The replaceProcessing method removes {f} and cuts the string. If i execute this string using pgAdmin it works perfectly ok. Also inserting this string using a prepared statement is ok. But i also have an occasion where strings like this will be inserted as statement.

Change in Log Format and Prepared Statements


Over the past year we have performed upgrades to both our PostgreSQL
server our jdbc driver over the last few months:

From PostgreSQL 8.2.10 with pg74.216.jdbc3 driver
To PostgreSQL 8.2.10 with pg8.2-511.jdbc4 driver
To PostgreSQL 9.1.4 with pg9.1-902.jdbc4 driver

(O/S is Centos 5)

When we moved from the pg74.216.jdbc3 driver to the pg8.2-511.jdbc4 we
saw a distinct change in the logging output by the database.

Previously with the pg74.216.jdbc3 driver we saw the statement followed
by a duration:

2012-09-13 13:08:48 BST [22116] [mp_demo] [pg] LOG: statement: SELECT

9.2 driver


Any plans to release 9.2 driver? PostgreSQL 9.2 was released on Monday,
and people already started pestering me about the JDBC RPMs :-)


Bug : FAST_NUMBER_FAILED when getting NaN on BigDecimal


It is impossible to fetch data when numeric value in database is NaN
(postgresql-jdbc-9.1-902:AbstractJdbc2ResultSet:2176) because my value
is not numeric (NaN).
This is incorect behaviour since 'NaN' is a legal value in postgres for
numeric type.

problem is in postgresql-jdbc-9.1-902.jdbc4
but it seems arround for ages... since I discovered it first in

best regards,


JDBC 9.1-901 Maven problem

Recently I downloaded JDBC 9.1-901 driver form
<a href="" title=""></a>. After invoking org.postgresql.util.PSQLDriverVersion from postgresql-9.1-901.jdbc4.jar much to my suprise the application output was: PostgreSQL 9.0 JDBC4 (build 801).
After downloading jar from <a href="" title=""></a> with version 9.1-902 everything worked as expected.
Is there any greater good behind this version mismatch?

Streaming bytea implementation offered


I have modified version 9.1-902 of the driver in order for it to stream bytea values when calling ResultSet.getBinaryStream(). The implementation is here:

<a href="" title=""></a>

When a bytea value is larger than 1MB it is streamed to a temporary file instead of being copied in the "answer" array. When the stream is later accessed, either with "getBinaryInputStream" or "getBytes", the bytes are fetched from the temporary file, which is subsequently deleted.

Reviewing the archives

Hi all

I've fetched the last 2 years archives with:

for y in `seq 2011 2012`; do
for m in `seq -w 1 12`; do
gunzip *

I've loaded an IMAP mailbox for easy full text search, flagging, etc:

for f in pgsql-jdbc*; do $f
imap://craig:xxxxxx@xxxxxx/pgsql-jdbc; done


Problem with client_encoding UTF8

I'm trying to restore a postgres database backup programmatically, I use
JDBC driver (postgresql-9.1-902.jdbc4), and I get the following error,

org.postgresql.util.PSQLException: The server's client_encoding parameter
was changed to UTF8.

Pgsql_JDBC Support Proposal

The discussion I open here is possibly an outlandish proposal
for the PgJDBC support requirements for the project, but is
really meant to enlist a basic discussion of a solution in this
area for the project's needs. I do not know the size of this
mailing list, but suspect it is fairly large, since PostgreSQL
has been gaining popularity in the last few years. I would
therefore assume that this is NOT a dying project.

setObject(...) with native Java arrays like String[] ?

Hi all

I was recently surprised to find that PgJDBC doesn't accept Java arrays
as parameters to prepared statements.

For example:

PreparedStatement.setObject(1, new String[]{"a"}).

will fail with:

[ERROR] Internal Exception: org.postgresql.util.PSQLException: Can't
infer a SQL
type to use for an instance of [Ljava.lang.String;.
Use setObject () with an explicit Types value to specify the type to use.


send/receive buffer size

I read a thread somewhere that somebody contributed a patch for adding support of configurable send/receive buffer size. Did it ever commit into master branch? I did not see any commit message about this change for last 12 months.

PGConnection getNotifications

I'm a newbie to postgreSQL so please forgive my ignorance. I am able to
write code that connects/updates a database. I copied a simple
Notify/Listen example and for the life of me I can't seem to figure out why
the getNotifications() method for the PGConnection class is undefined? All
the examples use it and the docs say its available after version 7.3 or so.
I've installed PostgreSQL 9.1.4, and link to postgresql-9.0-801.jdbc4.jar
in my project. What piece am I missing?


I'm a newbie to postgreSQL so please forgive my ignorance. I am able to
write code that connects/updates a database. I copied a simple Notify/Listen
example and for the life of me I can't seem to figure out why the
getNotifications() method for the PGConnection class is undefined? All the
examples use it and the docs say its available after version 7.3 or so.
I've installed PostgreSQL 9.1.4, and link to postgresql-9.0-801.jdbc4.jar in
my project. What piece am I missing?

pgbouncer transaction patch?

Happened upon this:

<a href="" title=""></a>

and the related (ancient) pgbouncer mailing list post

<a href="" title=""></a>

It seems sensible, but as far as I can tell, no attempt had ever been
made to upstream this. Any thoughts on accepting this?



Is it possible to update the ChangeLog on the website ?

<a href="" title=""></a>

It's missing the changes for

9.1-902 and 9.1-901.

Last update is for 9.1dev-900


Ger Timmens

wrong driver version in download link name


It seems version 902 is a bit daunted ...

On <a href="" title=""></a> row 9.1 Build 902 column
JDBC 4 you can read: "9.1-903 JDBC 4", although the link is correct
(<a href="" title=""></a>).


Luis Flores

translation updates


Attached are some translation updates for 9.1 and 9.2 branch. I also improve
some messages. Some of them adding "operation" to help translators understand
the context, be concise in case (CopyData) and normalize a sentence to avoid
two translations.

Is there a reason for 9.2 branch isn't listed in [1]? And the other branches
(9.0, 8.4, and 8.3)?

[1] <a href="" title=""></a>

Please consider using Maven


I'm a Debian maintainer working on a package that uses postgresql. I've to fix
the debian packaging of the jdbs lib because it does not come with maven's
pom.xml files. - That has nothing to do with you.

However I noticed, that you don't use maven.

From a packagers point of view it's very very convenient, if java libraries
all have a common layout and if they declare their dependencies in a pom.xml.

Syndicate content