<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hello Tatsuo et al.,<br>
    <br>
    I have a small piece of code that behaves differently through
    pgpool-II (currently development code) than through PostgreSQL 9.2:<br>
    <br>
    &lt;pre&gt;<br>
    package pg;<br>
    import java.sql.Connection;<br>
    import java.sql.DriverManager;<br>
    import java.sql.Statement;<br>
    <br>
    public class RepeatedFailures {<br>
    &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; private static final String[] queries = {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; "create table x",<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; "select splat from splatter",<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; "create table x(i int)"<br>
    &nbsp;&nbsp;&nbsp; };<br>
    <br>
    &nbsp;&nbsp;&nbsp; public static void main(String[] args) throws Exception {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Class.forName("org.postgresql.Driver");<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Connection conn =
    DriverManager.getConnection("jdbc:postgresql://{server}/seantest",
    "seantest", "seantest");<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for (String query : queries) {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Statement st = conn.createStatement();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; st.execute(query);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println("Success:&nbsp; "&nbsp; + query);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } catch (Exception e) {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println("Ignoring: " + e);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println("Completed");<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; conn.close();<br>
    &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; <br>
    }<br>
    &lt;/pre&gt;<br>
    <br>
    The first and second statements are meant to fail in different ways,
    and the last to succeed.<br>
    <br>
    If {server} is a pgpool-II instance then the last query is rejected
    with "current transaction is aborted, commands ignored until end of
    transaction block".&nbsp; If it is a real PostgreSQL instance it succeeds
    as one would expect.&nbsp; The pgpool-II server is set up in replication
    mode as per
    <meta http-equiv="content-type" content="text/html;
      charset=ISO-8859-1">
    <a
      href="http://pgpool.projects.pgfoundry.org/pgpool-II/doc/pgpool-en.html">http://pgpool.projects.pgfoundry.org/pgpool-II/doc/pgpool-en.html</a>.<br>
    <br>
    Note that auto-commit is default (true).<br>
    <br>
    If I comment out the syntactically incorrect statement (the first
    one), then the last query succeeds with both PostgreSQL and pgpool.<br>
    <br>
    Is this a bug, or expected behaviour?<br>
    <br>
    Thanks,<br>
    Sean<br>
  </body>
</html>