Search Postgresql Archives

Postgresql post_parse_analyze_hook not getting triggered for COMMIT command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello All,

I am trying to build a postgres extension 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:
  • 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 = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
// insert an actor into the actor table
String SQLInsertActor = "INSERT INTO actor(first_name,last_name) VALUES(?,?)";
try {
// connect to the database
conn = connect();
conn.setAutoCommit(false);
int i=0;
while (i < 5) {
// add actor
pstmt = conn.prepareStatement(SQLInsertActor, Statement.RETURN_GENERATED_KEYS);
pstmt.setString(1, actor.getFirstName());
pstmt.setString(2, actor.getLastName());
pstmt.executeUpdate();
// commit the transaction if everything is fine
conn.commit();
i++;
}
}
Now what is happening I am receiving all the hook call backs for INSERT statement always. BEGIN and COMMIT being utility statement hooks come for parse, process utility hook, . However from second iteration onwards, while BEGIN 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 parse callback to extension?


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux