pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeroen T. Vermeulen <jtv@xs4all.nl>
To: Jan Klostermann <klostermann@rhf.de>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: Parameterized queries
Date: Fri, 14 Nov 2003 17:28:40 +0100
Message-ID: <20031114162840.GC9538@xs4all.nl> (raw)
In-Reply-To: <001b01c3aac9$2a7d77c0$f564a8c0@BARCELONA>
References: <001b01c3aac9$2a7d77c0$f564a8c0@BARCELONA>

On Fri, Nov 14, 2003 at 05:05:46PM +0100, Jan Klostermann wrote:
> 
> I would like to know, if there exists a way in PostgreSQL to insert data
> not exclusively via the SQL-query-string but using a direct data
> interface, thus avoiding parsing the data into string and then back into
> binary data representation (e.g. Double). 
 
You could use binary cursors.


> What I would like to use is a query like this: INSERT INTO table
> (number1, number2) VALUES (?,?)
> Before executing the query the command structure would be fill with the
> parameters for the 2 values (e.g. 3.33 and 5.555) and then there would
> follow the execution, where the query parser would replace the "?" with
> the current data of the parameters and execute the appopriate query.

Wouldn't it be easier in this case to skip the SQL altogether and just
use the COPY command to pump data into the table with minimal processing?  
You'd still go through the parsing, but that may end up saving you trouble
anyway if you ever need to run the server and the client on different
machines--and I wouldn't be surprised if going through SQL is costing you
more than the value parsing anyway.



view thread (3+ messages)  latest in thread

Message-ID: <20031114162840.GC9538@xs4all.nl>
Permalink:  ../20031114162840.GC9538@xs4all.nl/
Also on:    postgresql.org/message-id/20031114162840.GC9538@xs4all.nl

 · 

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: jtv@xs4all.nl, klostermann@rhf.de
  Subject: Re: Parameterized queries
  In-Reply-To: <20031114162840.GC9538@xs4all.nl>

* 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