Re: [libdbi-users] postgresql and copy command

2008-04-05 Thread Markus Hoenicka
João Henrique Freitas writes: > Hello, > > Now it's works > I've checked in your patches as the tests run ok on my platform too. While being at it I've also fixed an off-by-one error in dbd_quote_binary() which I haven't noticed previously. regards, Markus -- Markus Hoenicka [EMAIL PROTEC

Re: [libdbi-users] postgresql and copy command

2008-04-04 Thread Markus Hoenicka
Quoting João Henrique Freitas <[EMAIL PROTECTED]>: > In weekend, I will try to do a complete example with g++. But the key > is use typedef (see http://www.newty.de/fpt/functor.html) > Thanks a lot for the example code. This is probably already sufficient for the experienced C++ programmer, but

Re: [libdbi-users] postgresql and copy command

2008-04-03 Thread João Henrique Freitas
Ok, I will try: // mdb->db is dbi_conn *db dbi_conn_t *myconn = (dbi_conn_t *)(mdb->db); // the key is use typedef. The function need be typedef typedef int (*custom_function_t)(void*, const char*, int); typedef char* (*custom_function_error_t)(void*); // function pointers int (*custom_function)(v

Re: [libdbi-users] postgresql and copy command

2008-03-31 Thread João Henrique Freitas
Hello, Now it's works PQputCopyEnd and PQputCopyData, basicaly. -- Test 8: Run driver-specific function parameters: libdbi: [query] CREATE TABLE batch ( id int, jobid int, jobname varchar) Ok. libdbi: [query] COPY ba

Re: [libdbi-users] postgresql and copy command

2008-03-29 Thread João Henrique Freitas
Hello > I will do more tests and report then. Here is my tests. Follow... First, libdbi specific functions apparently works well. (in linux, gcc, mysql and pgsql) My objective is to use libdbi and pgsql driver (but in future this can be for others drivers too) capable to do a batch insert (lik

Re: [libdbi-users] postgresql and copy command

2008-03-28 Thread João Henrique Freitas
Ok, Multiple parameters works well too. I am using g++ and need a typedef (typedef int (*custom_function)(void*, int);) to works. With gcc it works without the need of typedef Thanks On Tue, Mar 18, 2008 at 8:57 PM, Markus Hoenicka <[EMAIL PROTECTED]> wrote: > João Henrique Freitas writes: >

Re: [libdbi-users] postgresql and copy command

2008-03-28 Thread Markus Hoenicka
Quoting João Henrique Freitas <[EMAIL PROTECTED]>: > > Markus, what is : "custom_functions went to 0x80576f0" and > "custom_functions went to 0x805a048" > Don't worry about that, this is a leftover printf() call which I inserted during debugging. This simply told me whether or not the custom

Re: [libdbi-users] postgresql and copy command

2008-03-27 Thread João Henrique Freitas
Hello --- [EMAIL PROTECTED]:~/workspace/libdbi-drivers/tests$ ./test_dbi libdbi-drivers test program: $Id: test_dbi.c,v 1.50 2008/03/07 20:51:27 mhoenicka Exp $ test recallable (r) or legacy (l) libdbi interface? [r] libdbi driver directory? [/usr/local/lib/dbd] custom_functions went

Re: [libdbi-users] postgresql and copy command

2008-03-27 Thread João Henrique Freitas
Oh, it's works. Great! Test 2: Run driver-specific function: mysql_get_proto_info returned: 10 I did a quick test and "make check" works. I will do more tests and report then. Thanks On Thu, Mar 27, 2008 at 4:44 PM, Markus Hoenicka <[EMAIL PROTECTED]> wrote: > João Henrique Freitas wr

Re: [libdbi-users] postgresql and copy command

2008-03-27 Thread Markus Hoenicka
Markus Hoenicka writes: > João Henrique Freitas writes: > > It's realy works? > > > > Could you please try the latest cvs version? I've discovered a Just to make sure: as the fix includes a modification of configure.in, you'll have to re-run ./autogen.sh and ./configure to get everything

Re: [libdbi-users] postgresql and copy command

2008-03-27 Thread Markus Hoenicka
João Henrique Freitas writes: > It's realy works? > Could you please try the latest cvs version? I've discovered a portability issue of dlsym on at least FreeBSD and Linux. This does apparently not affect the symbols which are directly loaded by dlopen() (i.e. the driver functions), but those s

Re: [libdbi-users] postgresql and copy command

2008-03-18 Thread Markus Hoenicka
João Henrique Freitas writes: > > int (*custom_function)(void*, int); > > > It's realy works? > It is supposed to work. However, as the custom function stuff apparently does not work at all on Linux, I'll have to revisit this stuff anyway later this week. If possible at all, I'll add a test

Re: [libdbi-users] postgresql and copy command

2008-03-18 Thread João Henrique Freitas
> João Henrique Freitas writes: > > Some questions; > > - If custom_function(myconn->connection) need more parameters (ex:. > > for the function > > dbi_driver_specific_function(dbi_conn_get_driver(conn), > > "mysql_get_row")) like custom_function(myconn->connection, > > command_sql) i

Re: [libdbi-users] postgresql and copy command

2008-03-18 Thread Markus Hoenicka
João Henrique Freitas writes: > What plataform you use to test? > I'm running FreeBSD 6.1-RELEASE with these database engines: mysql Ver 14.12 Distrib 5.0.51a, for portbld-freebsd6.1 (i386) using 5.0 postgres (PostgreSQL) 8.0.15 The gmake check output for mysql looks like this: Library inf

Re: [libdbi-users] postgresql and copy command

2008-03-17 Thread João Henrique Freitas
Markus, What plataform you use to test? I am using cvs version of libdbi and libdbi-drivers. Now I stay in Mandriva Linux. > or there may be yet another platform issue. To check the former, could > you please let me know which versions of MySQL and PostgreSQL you run? Mysql version: 5.0.45 M

Re: [libdbi-users] postgresql and copy command

2008-03-17 Thread Markus Hoenicka
João Henrique Freitas writes: > Markus, what's the status of this implementations? Is works? > Well, it does work on my box. If it doesn't work on your box, it may be due to a version issue (maybe the functions that the test program checks just so happen to be missing in your version of the dat

Re: [libdbi-users] postgresql and copy command

2008-03-16 Thread João Henrique Freitas
Hello, > I've started implementing the driver_specific_function API for the > firebird, mysql, pgsql, sqlite, and sqlite3 drivers. Using the API > required minor changes in libdbi as well, so in order to test the > interface you'll need the CVS versions of both libdbi and > libdbi-drivers. >

Re: [libdbi-users] postgresql and copy command

2008-03-14 Thread Markus Hoenicka
João Henrique Freitas writes: > Some questions; > - If custom_function(myconn->connection) need more parameters (ex:. > for the function > dbi_driver_specific_function(dbi_conn_get_driver(conn), > "mysql_get_row")) like custom_function(myconn->connection, > command_sql) is possible too, ok?

Re: [libdbi-users] postgresql and copy command

2008-03-14 Thread João Henrique Freitas
Hello, I start my tests with dbi_driver_specific_function(). For now, my tests fail but I need investigate why and report more details here. In test cases test_dbi.c: if ((custom_function = dbi_driver_specific_function(dbi_conn_get_driver(conn), "mysql_get_proto_info")) != NULL) { protocol

Re: [libdbi-users] postgresql and copy command

2008-03-10 Thread João Henrique Freitas
Ok, thanks. I will follow CVS and test this. On Fri, Mar 7, 2008 at 5:31 PM, Markus Hoenicka <[EMAIL PROTECTED]> wrote: > João Henrique Freitas writes: > > Hello, > > > > Is a way to use PQputCopyData and PQputCopyEnd (like describe > > http://www.postgresql.org/docs/8.3/static/libpq-copy

[libdbi-users] postgresql and copy command

2008-03-07 Thread Markus Hoenicka
João Henrique Freitas writes: > Hello, > > Is a way to use PQputCopyData and PQputCopyEnd (like describe > http://www.postgresql.org/docs/8.3/static/libpq-copy.html) with libdbi > framework? > > Maybe *dbi_driver_specific_function()? > I've started implementing the driver_specific_funct

Re: [libdbi-users] postgresql and copy command

2008-03-04 Thread Markus Hoenicka
João Henrique Freitas writes: > Hello > > For now no. > In the code that I am convert to libdbi this two functions > (PQputCopyData and PQputCopyEnd) it is not covered by libdbi. > > Postgresql COPY is not SQL standard yet. > Thanks again. I'm still trying to figure out how the custom f

Re: [libdbi-users] postgresql and copy command

2008-03-03 Thread João Henrique Freitas
Hello For now no. In the code that I am convert to libdbi this two functions (PQputCopyData and PQputCopyEnd) it is not covered by libdbi. Postgresql COPY is not SQL standard yet. Thanks - This SF.net email is sponsored by:

Re: [libdbi-users] postgresql and copy command

2008-02-28 Thread Markus Hoenicka
Quoting João Henrique Freitas <[EMAIL PROTECTED]>: > Hello, > > Is a way to use PQputCopyData and PQputCopyEnd (like describe > http://www.postgresql.org/docs/8.3/static/libpq-copy.html) with libdbi > framework? > > Maybe *dbi_driver_specific_function()? > Basically yes. I've never looked into th

[libdbi-users] postgresql and copy command

2008-02-27 Thread João Henrique Freitas
Hello, Is a way to use PQputCopyData and PQputCopyEnd (like describe http://www.postgresql.org/docs/8.3/static/libpq-copy.html) with libdbi framework? Maybe *dbi_driver_specific_function()? Thanks -- --- João Henrique Freitas - joaohf_at_