Skip site navigation (1) Skip section navigation (2)

PQexecPrepared() behavior

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: PQexecPrepared() behavior
Date: 2009-08-30 12:01:55
Message-ID: 20090830.210155.70221428.t-ishii@sraoss.co.jp (view raw or flat)
Thread:
Lists: pgsql-hackers
While looking into a pgpool-II problem reported by a user, I found
weird behavior of PQexecPrepared().

Strange thing is, it seems PQexecPrepared() sends B(bind), Describe,
Execute and Sync at once without checking the result of Bind
message. Is this leagal from a point of view of the frontend/backend
protocol?  PostgreSQL version is 8.4.0.

Here is the trace.

To backend> Msg Q
To backend> "begin;"
To backend> Msg complete, length 12
>From backend> C
>From backend (#4)> 10
>From backend> "BEGIN"
>From backend> Z
>From backend (#4)> 5
>From backend> Z
>From backend (#4)> 5
>From backend> T
Preparing the statement...
To backend> Msg P
To backend> ""
To backend> "INSERT INTO test_table (a) VALUES ($1)"
To backend (2#)> 1
To backend (4#)> 0
To backend> Msg complete, length 51
To backend> Msg S
To backend> Msg complete, length 5
>From backend> 1
>From backend (#4)> 4
>From backend> Z
>From backend (#4)> 5
>From backend> Z
>From backend (#4)> 5
>From backend> T
Executing the statement...
To backend> Msg B <-- Bind
To backend> ""
To backend> ""
To backend (2#)> 0
To backend (2#)> 1
To backend (4#)> 5
To backend> 123.5
To backend (2#)> 1
To backend (2#)> 0
To backend> Msg complete, length 24
To backend> Msg D <-- Describe
To backend> P
To backend> ""
To backend> Msg complete, length 7
To backend> Msg E <-- Execute
To backend> ""
To backend (4#)> 0
To backend> Msg complete, length 10
To backend> Msg S <-- Sync
To backend> Msg complete, length 5
>From backend> E
>From backend (#4)> 88
>From backend> S
>From backend> "ERROR"
>From backend> C
>From backend> "22P02"
>From backend> M
>From backend> "invalid input syntax for integer: "123.5""
>From backend> F
>From backend> "numutils.c"
>From backend> L
>From backend> "106"
>From backend> R
>From backend> "pg_atoi"
>From backend> 

Responses

pgsql-hackers by date

Next:From: Simon RiggsDate: 2009-08-30 12:22:41
Subject: Re: LWLock Queue Jumping
Previous:From: Grzegorz JaskiewiczDate: 2009-08-30 11:21:04
Subject: Re: clang's static checker report.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group