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

Owner: greg [...]
Requestors: cpan-20090118-7280 [...]

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 [...]
From: Gerhard Heift <cpan-20090118-7280 [...]>
Download (untitled) / with headers
text/plain 815b
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]
Download signature.asc
application/pgp-signature 197b

Message body not shown because it is not plain text.

Download (untitled) / with headers
text/plain 368b
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

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to