Re: Extended Query, flush or sync ?

From: John DeSoi <desoi(at)pgedit(dot)com>
To: Raimon Fernandez <coder(at)montx(dot)com>
Cc: pgsql-general List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Extended Query, flush or sync ?
Date: 2009-12-21 01:30:11
Message-ID: 03F6E9C9-59AF-4F9B-837A-822C224DCD22@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-interfaces

Hi Raimon,

On Dec 20, 2009, at 2:11 PM, Raimon Fernandez wrote:

>
> I'm not seeing my e-mails on the PostgreSQL General List ...
>
> ??????

Yes, my last message did not make it to the list yesterday (you obviously received it). I double checked and it was cc to the list.

> I can pack all of them and send them at the same time, except de Parse, that will go at the connection beggining in my case.

I have two routines, prepare and exec_prepare.

To prepare a named statement for multiple uses, I use prepare (parse, describe, sync).

exec_prepare can take a statement from prepare OR you can pass it the unparsed SQL instead (along with the parameters). In the second case it performs the parse first with the unnamed prepared statement (empty string) and then executes it. This is nice because if you don't need multiple executions, you can build and execute with a single network write and read. You get the safety of parameterized execution and you don't have a prepared statement to dispose of in another operation.

John DeSoi, Ph.D.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2009-12-21 01:36:55 Re: Cheapest way to poll for notifications? & Driver improvement question re SSL and notify
Previous Message Maciek Sakrejda 2009-12-21 01:24:39 Re: Cheapest way to poll for notifications? & Driver improvement question re SSL and notify

Browse pgsql-interfaces by date

  From Date Subject
Next Message Raimon Fernandez 2009-12-22 16:01:34 Extended Query vs Simple Query
Previous Message Raimon Fernandez 2009-12-20 19:11:49 Re: Extended Query, flush or sync ?