Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 2CE72B5DBEA for ; Thu, 26 May 2011 17:43:01 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 53951-04 for ; Thu, 26 May 2011 20:42:52 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp104.prem.mail.ac4.yahoo.com (smtp104.prem.mail.ac4.yahoo.com [76.13.13.43]) by mail.postgresql.org (Postfix) with SMTP id 15C53B5DBE6 for ; Thu, 26 May 2011 17:42:51 -0300 (ADT) Received: (qmail 83598 invoked from network); 26 May 2011 20:42:51 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=DKIM-Signature:Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:X-Mailer:Thread-Index:Content-Language; b=gjOQbk8M19uMy8zMdlZO1iU6U30ahbms6TFsYCNZJOe1YaWdmh00s4PtrgjKzU0odjLhnQcrEFpQzBaoQ5vqHJD7Lj6HDRHpg4X9SxHg7EmH67GQ5LNN2oFNXd11SQ73p5IJZ3QSI4HuJVGC/LQi0Bdpte+TJTwSuKH4bF51e3k= ; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1306442571; bh=j0+76ZCRlyU6a9uXbNyr2sit2xxG58Gpq/3Zlw2pvN4=; h=Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:X-Mailer:Thread-Index:Content-Language; b=DJ+/ZcDt0Vi/TI3+yLVMpgwsZg5KxRCToLLqM3Wd8mFSatDPAhuPleTu65Fprsh0kx+v0Sm1dluRykUWMiLhHMTGllqw1DJHARhNBwVmfZfzD3HyTZYFvEeMIpAMfpxyMWBGqTN+hY0ofZnBD40fYwsCarzQMwpjdLmTtRfdu88= Received: from WolfDog (polobo@66.67.24.143 with login) by smtp104.prem.mail.ac4.yahoo.com with SMTP; 26 May 2011 13:42:50 -0700 PDT X-Yahoo-SMTP: mpGJl6eswBD2IBufoVEg0Pa8gg-- X-YMail-OSG: PGIDdgUVM1mbkI5bo7hHd3ZUJy1L9LxVDNYJ62FJWPto167 ggU6jOqOGgPGmwpX.SVTj5aPtrW2qw1e3EayoJNylxGjEPy7FupjlxXFzWRV 6r89kjVEtbHSYxO4q6HEKxDjCuHCQ0lv5iR1pfRXjl6WlyhRLQsfdnAdneRI QWDDKIt9HxLDbmAvXiz9VWIxlobgBwqN88vPyJsiIBk44rPhiRmwWcA3yQEA e.Oxxx0m0BdIXeuRxXXokecnWSwVdTl39gU8CviDoefYOMQdmbyN5HCeamH1 gg_5AxezYfPN.6O2rKhSwgzKz2k5v6Edzq.LSnEpiSskANQMVqM7R2APiyiP uCUxY79QmukHK.ytEO9MnYg-- X-Yahoo-Newman-Property: ymail-3 From: "David Johnston" To: Subject: Inconsistent "Set Local search_path" behavior in JDBC Date: Thu, 26 May 2011 16:42:46 -0400 Message-ID: <000301cc1be5$789a9880$69cfc980$@yahoo.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0004_01CC1BC3.F189E2E0" X-Mailer: Microsoft Outlook 14.0 Thread-Index: Acwb5XgZyFqsoGFkSvKerS45quq0fA== Content-Language: en-us X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.906 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RFC_ABUSE_POST=0.001, T_RP_MATCHES_RCVD=-0.01, UNPARSEABLE_RELAY=0.001 X-Spam-Level: X-Archive-Number: 201105/78 X-Sequence-Number: 21908 This is a multipart message in MIME format. ------=_NextPart_000_0004_01CC1BC3.F189E2E0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit While doing some test development I observed the following behavior when using SET LOCAL search_path TO . within a adhoc (BEGIN . COMMIT) transaction. I am working with a multiple schema database using 9.0.3 in Windows 7 64-bit / 9.0.801 driver I had previously issued: SET DATABASE search_path TO public, domain; I then issue: BEGIN; SET LOCAL search_path = process, domain; [note that process is not on the database search path] CREATE TABLE t . COMMIT; At which point the table appears in the process domain. I then issue: BEGIN; SET LOCAL search_path = process, domain; INSERT INTO t (.) VALUES (.); COMMIT; And I get an exception that: "relation "t" does not exist" If I then go back and issue: SET DATABASE search_path TO public, domain, process; [adding process to the database search path] I am able to successfully run the INSERT INTO transaction. If I run the same commands (the INSERT INTO transaction) in my GUI environment (PostgreSQL Maestro) it does not matter whether the DATABASE search_path includes "process". It, for some reason, also does not seem to matter when issuing the "CREATE TABLE" transaction within JDBC. David J. ------=_NextPart_000_0004_01CC1BC3.F189E2E0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

While = doing some test development I observed the following behavior when using = SET LOCAL search_path TO … within a adhoc (BEGIN … COMMIT) = transaction.

 

I am working with a multiple schema database using = 9.0.3 in Windows 7 64-bit / 9.0.801 driver

 

I had = previously issued:

 

SET DATABASE = search_path TO public, domain;

 

I then = issue:

 

BEGIN;

SET LOCAL = search_path =3D process, domain; [note that process is not on the = database search path]

CREATE TABLE t = …

COMMIT;

 

At which = point the table appears in the process domain.

 

I then = issue:

BEGIN;

SET LOCAL search_path =3D process, = domain;

INSERT INTO t (…) = VALUES (…);

COMMIT;

 

And I get an = exception that:

 

“relation "t" does not = exist”

 

If I then go back and issue:

 

SET DATABASE = search_path TO public, domain, process; [adding process to the database = search path]

 

I am able to successfully run the INSERT INTO = transaction.

 

If I run the same commands (the INSERT INTO = transaction) in my GUI environment (PostgreSQL Maestro) it does not = matter whether the DATABASE search_path includes = “process”.  It, for some reason, also does not seem to = matter when issuing the “CREATE TABLE” transaction within = JDBC.

 

David J.

 

 

 

 

------=_NextPart_000_0004_01CC1BC3.F189E2E0--