Skip Menu |

This queue is for tickets about the DBD-Pg CPAN distribution.

Report information
The Basics
Id: 48155
Status: resolved
Priority: 0/
Queue: DBD-Pg

People
Owner: greg [...] turnstep.com
Requestors: cpan-20090118-7280 [...] gheift.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 2.15.0



Subject: [DBD::Pg] statement without any arguments is not prepared on server side
Date: Fri, 24 Jul 2009 12:05:46 +0200
To: bug-DBD-Pg [...] rt.cpan.org
From: Gerhard Heift <cpan-20090118-7280 [...] gheift.de>
Hello, if I have a select statement without argument, which i call often, it is not prepared on the server side. In the dbdimp.c it is written as a comment: /* We use the new server_side prepare style if: 1. The statement is DML 2. The attribute "pg_direct" is false 3. The attribute "pg_server_prepare" is not 0 4. There is one or more placeholders (but "onetime" has not been set) 5. There are no DEFAULT or CURRENT values 6a. The attribute "pg_server_prepare" is 1 OR 6b. All placeholders are bound (and "pg_server_prepare" is 2) */ But why is preparing on the serverside disabled if there is no placeholder? I did not found anything about this limitation in the documentation [1]. Regards, Gerhard [1] http://www.postgresql.org/docs/8.0/static/libpq-exec.html#AEN23200
Download signature.asc
application/pgp-signature 197b

Message body not shown because it is not plain text.

It was simply a design decision to simply use PQexec directly if there are no placeholders, rather than creating a prepared statement, executing it, and then tearing it down. However, in retrospect it seems as though it might be a good idea to prepare it anyway to gain the advantage of a cached prepare plan, so I'm open to changing it. Anyone else want to weigh in?
Behavior changed to use PQexecParams in r13152