Re: [GENERAL] Libpq binary mode SELECT ... WHERE ID IN ($1) Question

2009-11-13 Thread Andrew Chernow
Merlin Moncure wrote: On Fri, Nov 13, 2009 at 1:34 AM, Matt Sanchez wrote: Hello, Suppose I have a table: create table foo ( id int4, name varchar(50) ); I want to prepare and execute in binary mode: select name from foo where id in ($1); Execute works when I have a single valu

Re: [GENERAL] Libpq binary mode SELECT ... WHERE ID IN ($1) Question

2009-11-13 Thread Merlin Moncure
On Fri, Nov 13, 2009 at 1:34 AM, Matt Sanchez wrote: > Hello, > > Suppose I have a table: >        create table foo ( id int4, name varchar(50) ); > > I want to prepare and execute in binary mode: >        select name from foo where id in ($1); > > Execute works when I have a single value for $1,

Re: [GENERAL] Libpq binary mode SELECT ... WHERE ID IN ($1) Question

2009-11-12 Thread silly8888
You could try to prepare a query like this: select name from foo where id=any($1); and then pass the array of integers as $1 (although, I don't know how you can do that as I've never used the C interface of libpq). On Fri, Nov 13, 2009 at 1:34 AM, Matt Sanchez wrote: > Hello, > > Suppose