Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iEuGG-00053r-HQ for pgsql-bugs@arkaria.postgresql.org; Mon, 30 Sep 2019 11:54:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iEuGF-0000AX-8e for pgsql-bugs@arkaria.postgresql.org; Mon, 30 Sep 2019 11:54:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iEtzw-0000Vv-Lv for pgsql-bugs@lists.postgresql.org; Mon, 30 Sep 2019 11:37:49 +0000 Received: from sonic310-23.consmr.mail.ne1.yahoo.com ([66.163.186.204]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iEtzt-0006ef-Gx for pgsql-bugs@lists.postgresql.org; Mon, 30 Sep 2019 11:37:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1569843461; bh=d4w6feOTgGBs6B06Ck5FKSnBwHnMAiRlSSOr47IFq60=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From:Subject; b=exeH6UcQhxuo4htbcB2A+dF9QG+6NIWsIPE0diQWjvfVVSAKXDZgUrpNh2F8CNhazV5kVNpYY5emn+7HP8xErH7ycx3ebIKtbqsQaNjoykSrFe46erEvhnLmZAOKxslpM2DGfYB2pDrPX8tnVtbaGWwT8crz66lP6R+ZTpFpd+3U5oroOCJHmeGIu8NbducYYWyl3/Nitk1ZYk//G6DbLSpcQl1tya4SnE4+CmJJOn+unXD7+m9ffvwuLJBB0dIgOjcaPQO6vygG3P59QZo1Rpntzo4frxDAarrTAu/IhGkgMC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n.MKpr2f_ZcH HKRYT37PCWIqZ9N3dcWkn.AlumAzEIfFifKt9jP.tP26I_hdAfiyCKHL0Tf8GHZLLD2kbmgVRJK3 d4CNKu9vBOO45o_B2Hoz493tO0MKZ8Qr249l7MbFceltH85eCa9Tb97c55RTKzXn6DzGBAc7t8US mTFwjFenVVtO_V5X37GAtoKjU9MewVzxeYg1okG8u6LAWnOOrAXpK36o_iYS2kdvQWK5i2.mzysa PbJDrmuysr7W0yg2WgZ1gvxTH_oHILkr1zcz8mZpYEk1quwPj0N4l7b83jbRqECZEroTK8wB0ViE - Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.ne1.yahoo.com with HTTP; Mon, 30 Sep 2019 11:37:41 +0000 Date: Mon, 30 Sep 2019 11:37:37 +0000 (UTC) From: Alex To: Dave Cramer Cc: PG Bug reporting form , pgsql-bugs@lists.postgresql.org Message-ID: <288920436.1347006.1569843457296@mail.yahoo.com> In-Reply-To: References: <16028-3b4724da97a51b77@postgresql.org> <2007560436.1326832.1569838383795@mail.yahoo.com> Subject: Re: BUG #16028: JDBC currentSchema connection parameter not working for text search configuration MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1347005_1625559077.1569843457294" X-Mailer: WebService/1.1.14448 YMailNorrin Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0 Content-Length: 12336 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------=_Part_1347005_1625559077.1569843457294 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable What's the behavior when both "currentSchema" is specified in the connecti= on uri and "search_path" is overwritten to a different value by the app (in= side the same transaction as the query)?Neither https://jdbc.postgresql.org= /documentation/head/connect.html, nor https://www.postgresql.org/docs/9.1/r= untime-config-client.html mention the behavior. On Monday, September 30, 2019, 1:56:38 PM GMT+3, Dave Cramer wrote: =20 =20 Alex, On Mon, 30 Sep 2019 at 06:13, Alex wrote: Additional info:The original schema was exported using pg_dump (whole db) = and imported using "psql -f".=20 Then I've renamed the schema in PgAdmin(4.13) to "dev" (right click -> Prop= erties -> change name -> Save). If I rename back the schema to original name, and use that name in "current= Schema" param, then everything works correctly. In addition, I don't know if any configuration may override the connection = param "currentSchema" (such as hibernate overwriting "search_path"), but in= my case it should be used as fallback to resolve missing text search confi= guration. Seems something else is going on then as this code: @Test public void testSchemaInProperties() throws Exception { Connection con =3D java.sql.DriverManager.getConnection("jdbc:postgresql:= //127.0.0.1:5432/test?currentSchema=3Ddev,public","test",""); Statement stmt =3D con.createStatement(); stmt.execute("SHOW search_path"); ResultSet rs =3D stmt.getResultSet(); if (!rs.next()) { Assert.fail("'options' connection initialization parameter should be pa= ssed to the database."); } Assert.assertEquals("'options' connection initialization parameter should= be passed to the database.", "dev,public", rs.getString(1)); stmt.close(); TestUtil.closeDB(con); } works fine. Dave.=C2=A0=C2=A0 On Monday, September 30, 2019, 3:45:48 AM GMT+3, Dave Cramer wrote: =20 =20 Interesting, Thanks for the report. Dave Cramer On Thu, 26 Sep 2019 at 18:16, PG Bug reporting form wrote: The following bug has been logged on the website: Bug reference:=C2=A0 =C2=A0 =C2=A0 16028 Logged by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 cd a Email address:=C2=A0 =C2=A0 =C2=A0 cdalxndr@yahoo.com PostgreSQL version: 10.3 Operating system:=C2=A0 =C2=A0Windows 10 Description:=C2=A0 =C2=A0 =C2=A0 =C2=A0=20 Using a java spring app with connection: jdbc:postgresql://localhost:5433/postgres?currentSchema=3Ddev,public&Applic= ationName=3Dmyapp Schema 'dev' has fts configuration 'en'. Query (debugged PgPreparedStatement): =C2=A0 select * from dev.category where category.language=3D'en' =C2=A0 the param 'en' is registered with oid (paramType) 3734 corresponding= to 'regconfig' type Query results in: ERROR: text search configuration "en" does not exist The same error is shown when running the query in PgAdmin if search_path doesn't contain 'dev' schema. With 'dev' in search_path, the query is ok. I was expecting that 'currentSchema' connection parameter will be used to resolve fts configuration to 'dev' schema. =20 =20 ------=_Part_1347005_1625559077.1569843457294 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
What's the behavior when bot= h "currentSchema" is specified in the connection uri and "search_path" is o= verwritten to a different value by the app (inside the same transaction as = the query)?
=20
=20
On Monday, September 30, 2019, 1:56:38 PM GMT+3, Dave C= ramer <davecramer@gmail.com> wrote:


Alex,


<= /div>
On Mon, 30 Sep 2019 at 06:13, Alex= <cdalxndr@yahoo.com<= /a>> wrote:


@Test
public void testSchemaInProperties() throws Exception = {
Connection con =3D java.sql.DriverManager.getConnection("jdbc:postgresql://
127.0= .0.1:5432/test?currentSchema=3Ddev,public","test","");

= Statement stmt =3D con.createStatement();
stmt.execute(= "SHOW search_path");

ResultSet rs =3D stmt.getResul= tSet();
if (!rs.next()) {
Assert.fail("'options' connection initialization parameter should be passed t= o the database.");
}
Assert.= assertEquals("'options' connection initialization param= eter should be passed to the database.", "dev,public", rs.getString(1));

stm= t.close();
TestUtil.= closeDB(con);
}

works fine.

Dave.&nb= sp; 

<= br clear=3D"none">
=20
=20
On Monday, September 30, 2019, 3:45:48 AM GMT+3, Dave C= ramer <davecramer= @gmail.com> wrote:


Interesting,

Thanks for the report.

D= ave Cramer


On Thu, 26 Sep 2019 at 18:16, PG Bug reporting form <= noreply@postgres= ql.org> wrote:
= The following bug has been logged on the website:

Bug reference:      16028
Logged by:          cd a
Email address:      cdalxndr@yahoo.com
PostgreSQL version: 10.3
Operating system:   Windows 10
Description:       

Using a java spring app with connection:
jdbc:postgresql://localhost:5433/postgres?currentSchema=3Ddev,public&Ap= plicationName=3Dmyapp
Schema 'dev' has fts configuration 'en'.
Query (debugged PgPreparedStatement):
  select * from dev.category where category.language=3D'en'
  the param 'en' is registered with oid (paramType) 3734 corresponding= to
'regconfig' type

Query results in: ERROR: text search configuration "en" does not exist

The same error is shown when running the query in PgAdmin if search_path doesn't contain 'dev' schema. With 'dev' in search_path, the query is ok. I was expecting that 'currentSchema' connection parameter will be used to resolve fts configuration to 'dev' schema.

------=_Part_1347005_1625559077.1569843457294--