Patch against 7.3.1 AbstractJdbc1Connection.java to allow schema in connectionURL

Lists: pgsql-jdbc
From: Andreas Joseph Krogh <andreak(at)officenet(dot)no>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Patch against 7.3.1 AbstractJdbc1Connection.java to allow schema in connectionURL
Date: 2002-12-22 12:34:59
Message-ID: 200212221335.06519.andreak@officenet.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!
I've attached a patch which makes it possible to choose which schema to
connect to by passing ?schema=myschema to the connectionURL like this:
connectionURL="jdbc:postgresql://localhost:5432/andreak?schema=public"

Apply as follows:
~/postgresql-7.3.1$ patch -p0 < AbstractJdbc1Connection.java.diff

Is this interesting? Can someone commit it to the HEAD branch?

- --
Andreas Joseph Krogh <andreak(at)officenet(dot)no>
There will always be someone who agrees with you
but is, inexplicably, a moron.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+BbF6UopImDh2gfQRAjNGAKC0lNucwj2AP3MYxNb4wUrezcpVTACfY/iI
IA6+RKczN3r62Uf7IEThg/s=
=ebb1
-----END PGP SIGNATURE-----


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andreas Joseph Krogh <andreak(at)officenet(dot)no>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Patch against 7.3.1 AbstractJdbc1Connection.java to allow schema in connectionURL
Date: 2002-12-22 16:48:09
Message-ID: 25543.1040575689@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Andreas Joseph Krogh <andreak(at)officenet(dot)no> writes:
> I've attached a patch which makes it possible to choose which schema to
> connect to by passing ?schema=myschema to the connectionURL like this:

Wouldn't it be better to set the preferred search path as part of your
per-user defaults? I'm suspicious of adding such warts to client
libraries.

Some objections to the patch as posted:

1. No documentation.

2. It appears that the patch will forcibly set the search path whether
the user asked for it or not. This means that any installation,
per-database, or per-user default setting will be overridden. The
patch's idea of the appropriate default does not even match the
factory default ("$user,public" IIRC).

3. (Another aspect of inappropriate default behavior) If public schema
doesn't exist, patch causes all connection attempts to fail.

regards, tom lane