Skip site navigation (1) Skip section navigation (2)

Patch to allow setting schema/search_path in the connectionURL

From: Scott Langley <slangley(at)scharp(dot)org>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Patch to allow setting schema/search_path in the connectionURL
Date: 2008-07-08 22:54:44
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
Many years ago, Andreas Joseph Krogh submitted a patch to allow the 
setting of the default schema in a JDBC connection string:

It was rejected with some objections:

I've made a modern version of this patch against the current CVS head 
that hopefully addresses the earlier objections on this list.  In this 
version, however, the parameter is called 'searchpath' instead of 'schema'

I find this functionality useful for a data reporting tool like BIRT:
that expects you to provide the JDBC connection parameters but where the 
  tool will build appropriate SQL queries for report generation - based 
on your manipulation of the report designer interface.  Our DBA likes to 
use postgresql schemas for namespace  management. Setting a searchpath 
keyword in the JDBC connection parameters allows the BIRT reports to be 
easily portable for use with differently-named schemas.



Incidentally, I noticed that the npgsql developers added similar 
functionality to their Posgresql driver in November of last year:


Scott Langley
Systems Analyst/Programmer
Statistical Center for HIV/AIDS Research and Prevention (SCHARP)
Fred Hutchinson Cancer Research Center
Seattle, Washington

Attachment: searchpath.patch
Description: text/plain (2.7 KB)


pgsql-jdbc by date

Next:From: Ken JohansonDate: 2008-07-09 04:08:56
Subject: Re: Timestamp without Timezone and differing client / server tzs
Previous:From: Dave CramerDate: 2008-07-08 10:53:53
Subject: Re: server-side prepared Statements

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group