pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedFrom: James Duong <jamesd@simba.com>
To: pgsql-interfaces@postgresql.org <pgsql-interfaces@postgresql.org>
Subject: libpq batched parameterized query execution
Date: Sat, 28 Jun 2014 03:25:30 +0000
Message-ID: <da267149dbb840f1868fab047ba3ff2d@BY2PR04MB584.namprd04.prod.outlook.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-interfaces>
Hi,
I'm wondering if it's possible to get libpq to batch multiple PQsendQueryParams() calls together.
It seems like currently we have to issue a PQsendQueryParams() call then call PQgetResult() until it returns NULL before we can start the execution. What would be good would be either:
1. I can keep sending them while the server is still processing the current one. After sending them all, I can keep calling PQgetResult() to iterate through them.
2. I can tell libpq "send all these PQsendQueryParams() calls together in one batch" to avoid excessive network roundtrips.
Maybe there's another option I don't see. COPY isn't really a solution, as I'm trying to take generic user input and send it to PostgreSQL as quickly as possible without parsing it. PQexec() can have semi-colon separated queries, but I need real parameters for this case.
Thanks
James Duong | Senior Computer Scientist | Simba Technologies Inc.
Tel +1.604.633.0008 ext. 120 | Fax +1.604.633.0004 | jamesd@simba.com<mailto:jamesd@simba.com>
938 West 8th Avenue | Vancouver, BC | Canada | V5Z 1E5
The Data Access and Analytics Experts | www.simba.com<http://www.simba.com/;
[Description: Description: Description: Description: twitter]<http://twitter.com/#!/simbatech; [Description: Description: Description: Description: youtube] <http://www.youtube.com/user/SimbaTechnologies; [Description: Description: Description: Description: linkedin] <http://ca.linkedin.com/in/simbatechnologies; [Description: Description: Description: Description: facebook] <http://www.facebook.com/pages/Simba-Technologies-Inc/163133087033256; [Description: Description: Description: Description: google-plus] <https://plus.google.com/116908198145591559055/posts; [Description: Description: Description: Description: typepad] <http://blogs.simba.com/;
This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure, or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Thank you.
Attachments:
[image/png] image001.png (499B, ../da267149dbb840f1868fab047ba3ff2d@BY2PR04MB584.namprd04.prod.outlook.com/3-image001.png)
download | view image
[image/png] image002.png (625B, ../da267149dbb840f1868fab047ba3ff2d@BY2PR04MB584.namprd04.prod.outlook.com/4-image002.png)
download | view image
[image/png] image003.png (515B, ../da267149dbb840f1868fab047ba3ff2d@BY2PR04MB584.namprd04.prod.outlook.com/5-image003.png)
download | view image
[image/png] image004.png (500B, ../da267149dbb840f1868fab047ba3ff2d@BY2PR04MB584.namprd04.prod.outlook.com/6-image004.png)
download | view image
[image/png] image005.png (734B, ../da267149dbb840f1868fab047ba3ff2d@BY2PR04MB584.namprd04.prod.outlook.com/7-image005.png)
download | view image
[image/png] image006.png (489B, ../da267149dbb840f1868fab047ba3ff2d@BY2PR04MB584.namprd04.prod.outlook.com/8-image006.png)
download | view image
Message-ID: <da267149dbb840f1868fab047ba3ff2d@BY2PR04MB584.namprd04.prod.outlook.com>
Permalink: ../da267149dbb840f1868fab047ba3ff2d@BY2PR04MB584.namprd04.prod.outlook.com/
Also on: postgresql.org/message-id/da267149dbb840f1868fab047ba3ff2d@BY2PR04MB584.namprd04.prod.outlook.com
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: jamesd@simba.com
Subject: Re: libpq batched parameterized query execution
In-Reply-To: <da267149dbb840f1868fab047ba3ff2d@BY2PR04MB584.namprd04.prod.outlook.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox