Re: exec_execute_message crush

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: books(at)ejurka(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: exec_execute_message crush
Date: 2009-12-29 06:22:31
Message-ID: 20091229.152231.68307810.t-ishii@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > parse
> > bind
> > describe
> > execute
> > <normaly done>
> > parse invalid SQL thus abort a transaction
> > bind (error)
> > describe (error)
> > execute (crush)
> >
> > Please note that without pgpool backend does not crush. This is
> > because JDBC driver does not do execute() if prior parse, bind
> > etc. failed, I think.
>
> The JDBC driver will fire away parse, bind, and execute all at once before
> a sync, to avoid network roundtrips, so your assumption of what's going on
> here without pgpool doesn't seem accurate. Attached is a test case that
> tries to duplicate what you've described and it errors out normally.
> Below is the JDBC driver's protocol level logging.
>
> 21:41:39.407 (1) FE=> Parse(stmt=S_1,query="BEGIN",oids={})
> 21:41:39.407 (1) FE=> Bind(stmt=S_1,portal=null)
> 21:41:39.407 (1) FE=> Execute(portal=null,limit=0)
> 21:41:39.408 (1) FE=> Parse(stmt=null,query="SELECT $1 ",oids={23})
> 21:41:39.408 (1) FE=> Bind(stmt=null,portal=null,$1=<'1'>)
> 21:41:39.408 (1) FE=> Describe(portal=null)
> 21:41:39.408 (1) FE=> Execute(portal=null,limit=0)
> 21:41:39.408 (1) FE=> Parse(stmt=null,query=" SELECT SELECT $1
> ",oids={23})
> 21:41:39.408 (1) FE=> Bind(stmt=null,portal=null,$1=<'2'>)
> 21:41:39.409 (1) FE=> Describe(portal=null)
> 21:41:39.409 (1) FE=> Execute(portal=null,limit=0)
> 21:41:39.409 (1) FE=> Sync
> 21:41:39.443 (1) <=BE ParseComplete [S_1]
> 21:41:39.443 (1) <=BE BindComplete [null]
> 21:41:39.443 (1) <=BE CommandStatus(BEGIN)
> 21:41:39.443 (1) <=BE ParseComplete [null]
> 21:41:39.443 (1) <=BE BindComplete [null]
> 21:41:39.444 (1) <=BE RowDescription(1)
> 21:41:39.444 (1) <=BE DataRow
> 21:41:39.444 (1) <=BE CommandStatus(SELECT)
> 21:41:39.454 (1) <=BE ErrorMessage(ERROR: syntax error at or near
> "SELECT"
> Position: 9)
>
> So this shows everything working as expected. Perhaps enabling this
> logging on your JDBC client would show more clearly what it is trying to
> do.

Thanks for clarification. I will look into more between pgpool and
PostgreSQL packet exchange.
--
Tatsuo Ishii
SRA OSS, Inc. Japan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Boszormenyi Zoltan 2009-12-29 07:50:49 Re: [PATCH] Provide rowcount for utility SELECTs
Previous Message Kris Jurka 2009-12-29 05:49:19 Re: exec_execute_message crush