Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1leIcq-00065o-QB for pgsql-general@arkaria.postgresql.org; Wed, 05 May 2021 14:35:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1leIcp-00019b-EY for pgsql-general@arkaria.postgresql.org; Wed, 05 May 2021 14:35:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1leI8x-0007Q8-GB for pgsql-general@lists.postgresql.org; Wed, 05 May 2021 14:04:52 +0000 Received: from sonic311-20.consmr.mail.sg3.yahoo.com ([106.10.244.37]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1leI8i-0006lT-Fa for pgsql-general@lists.postgresql.org; Wed, 05 May 2021 14:04:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.in; s=s2048; t=1620223468; bh=q/XAim4lJABc6xt0q44U4BiitLPVxyEluihDp50aaEU=; h=Date:From:Reply-To:To:Subject:References:From:Subject:Reply-To; b=YUUIXf2JWTTF6EImPBG+Kb8jnNzgVtHGRU02jOipJHitOyVKKagcZD1E2gdoNK2AfZNVb0MzKMUl6uJ5FjBipfEu6b81HaXHgjvJTuRDUlPHry0tnxQh6Jbs2UKBztRUuKmjhZhvlPnHywZcwqLnAMIEuPFy2R4Bmr2HKV06nJyQHnvO721GITwst9H7egFPNmuOvqkPsaRQ++/oGxfjvHYmO/JsmNfEZwtHCIYwQD0Un1Q2J4VEOe7IuaYsqUre717pdjZplkXgdhj6kTN37s9ZqoefQJxUyki7gCUB+YH1KpgK4C7rlLUn+EvGX/SE2JrGk06GKuMZxUkAGSQ/nw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1620223468; bh=1tPoz4slyNP3YvGWvXD7FBGYHj6ZwHugaTuYmMq5/MH=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=mz0sk0yLC1z/dgZtqGDW3yQNaksJGAgV5bzBwZkUc/PlZCD5l+b+Sjzc3P2+DYhNVfQs3Au2KgSIplqOiUbnKbKfVOUmcfCk7GUe5A6NT3alIW3mw3ljyZXG5EwLU5LB/gmgM2esOCDEslO0Z425kHrtmWtjdG5QZHr0q92ukpXwmVZpNjZYVWIMAp2MyoLh6xX6LetuYBXHKCSBidh4CNbomv6Zqb5qaVq8lIl0NlRbiWC8RwFKn+F4N8pA6KC/JWVsnM5zGFK6e1Xh1oLhEQnENUDilK6pvoSOOjauvQCW5fAJWeGUC4zp6obD3DBqRCY820n7d8X+iAmwtzXJtA== X-YMail-OSG: Jo6hw4MVM1lDyVQKWGUfO6li.U7T28y4I8HEhbjnnL_ZHW6kyLhcOFpQB8D1jzl wpJVDBetfaS8AaAjl.ylyA.EwFxqAi1Ike3WJg9AovkvQCI2c9OAqxFiPnQytaXN5TbxDWd66dpW xb4t_PCWJMApqWNwzRCIJnts6acpC11_WEdh2rYk.gICXmsz9k9MyBnprF0lXaX19cxSdCxfKkSK zWbQOXhvsfaT3EOElYN3zs02WihX6SJYet9KOgy2MFWZOX7YmcjCVW9cwRCkyP4k_kjFl9KyDQ5Y 8mTFdDDjlCK8s5_scLmmq9AUGxFFFCYItFsVm4iab8YHWQ1bycOIbTRC7kE4XKRF03VrB5LO14F2 JgTKTzHUUo1eDJdztgW5uKz_FHdlTvzUxB5sT1P71uMS.Cx1KhDycXV0Xa.ag94nclKo23.lq7qy JhqoOYutvibJxJem59DIb3NRhQbjq1UcBEh5kof2sMGt4Vs4uGPj1UPxXCHKkirqgJ5TjyH2Eces YvBU5IrznFBRzmBEBXtsN03WFYuecbX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- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.sg3.yahoo.com with HTTP; Wed, 5 May 2021 14:04:28 +0000 Date: Wed, 5 May 2021 14:04:23 +0000 (UTC) From: Soumya Prasad Ukil Reply-To: Soumya Prasad Ukil To: "pgsql-general@lists.postgresql.org" Message-ID: <569458024.606881.1620223463206@mail.yahoo.com> Subject: Postgresql post_parse_analyze_hook not getting triggered for COMMIT command MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_606880_2060005346.1620223463204" References: <569458024.606881.1620223463206.ref@mail.yahoo.com> X-Mailer: WebService/1.1.18231 YMailNorrin Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36 Content-Length: 6231 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------=_Part_606880_2060005346.1620223463204 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello All, I am trying to build a postgres extension and I have installed the followin= g hooks using this document=C2=A0https://wiki.postgresql.org/images/e/e3/Ho= oks_in_postgresql.pdf=C2=A0 The hooks that I have installed in my extension are the followings: =20 - shmem_startup_hook - post_parse_analyze_hook - ExecutorStart_hook - ExecutorRun_hook - ExecutorFinish_hook - ExecutorEnd_hook - ProcessUtility_hook Post that I am using a java program like below to fire sql statements in a = transaction: Connection conn =3D null; PreparedStatement pstmt =3D null; ResultSet rs =3D null;// insert an actor into the actor table String SQLInsertActor =3D "INSERT INTO actor(first_name,last_name) VALUES(?= ,?)";try { // connect to the database conn =3D connect(); conn.setAutoCommit(false); int i=3D0; while (i < 5) { // add actor pstmt =3D conn.prepareStatement(SQLInsertActor, Statement.RETURN_GE= NERATED_KEYS); pstmt.setString(1, actor.getFirstName()); pstmt.setString(2, actor.getLastName()); pstmt.executeUpdate(); // commit the transaction if everythi= ng is fine conn.commit(); i++; } }Now what is happening I am receiving all the hook call backs for INSERT st= atement always. BEGIN and COMMIT being utility statement hooks come for par= se, process utility hook, . However from second iteration onwards, while BE= GIN throws parse callback, but COMMIT command does not throw parse callback= . It directly throws process utility hook. Can you please help why second iteration onwards, commit does not throw par= se callback to extension? ------=_Part_606880_2060005346.1620223463204 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hello All,

I am trying to build a postgres e= xtension and I have installed the following hooks using this document = https://wiki.postgresql.org/images/e/e3= /Hooks_in_postgresql.pdf 

The hooks that = I have installed in my extension are the followings:
  • shme= m_startup_hook
  • post_parse_analyze_hook
  • ExecutorStart_hook
  • ExecutorRun_hook
  • ExecutorFinish_hook
  • ExecutorEnd_hoo= k
  • ProcessUtility_hook
Post that I am using a java program = like below to fire sql statements in a transaction:

=
Connection conn =3D null;
PreparedStatement pstmt =3D null;
R= esultSet rs =3D null;
// insert an actor into the actor table
String SQLInsertActor =3D= "INSERT INTO actor(first_name,last_name) VALUES(?,?)";
try {
// connect to the da= tabase
conn =3D connect();
conn.setAutoCommit(false);
= int i=3D0;
wh= ile (i < 5) {
// add actor
pstmt =3D conn.prepareS= tatement(SQLInsertActor, Statement.RETURN_GENERATED_KEYS);
pstmt= .setString(1, actor.getFirstName());
pstmt.setString(2, actor.ge= tLastName());
pstmt.executeUpdate();
// commit the transaction if everyth= ing is fine
conn.commit();
i++;
}
}
<= /pre>
Now what= is happening I am receiving all the hook call backs for INSERT statement a= lways. BEGIN and COMMIT being utility statement hooks come for parse, proce= ss utility hook, . However from second iteration onwards, while BEGIN throw= s parse callback, but COMMIT command does not throw parse callback. It dire= ctly throws process utility hook.
Can you please help why second iteration onward= s, commit does not throw parse callback to extension?

------=_Part_606880_2060005346.1620223463204--