Am I missing something or can't you just add another set of function pointers 
to the PDO driver and statements like:

driver_methods = {
...
        pg_copy_from, /* OR NULL IF NOT SUPPORTED */
        pg_copy_to
};

statement_methods = {
...
        pg_copy_to
};

Then if the driver does not implement it, throw an exception. Then, in the 
future, these could be abstracted on a higher level for drivers that don't 
support it by using lower level INSERT / SELECTS. The difference in the 
abstraction being that the files would be on the client side, not the server.

The initial values would of course be NULL except fo the PostgreSQL PDO drivers.

Then call the functions as $pdo_obj->copyFrom(...) and $pdo_obj->copyTo(...) or 
$pdo_stmt->copyTo(...)

>-----Original Message-----
>From: Denis Gasparin [mailto:denis.gaspa...@edistar.com]
>Sent: Thursday, June 03, 2010 1:32 PM
>To: Johannes Schlüter
>Cc: Pierre Joye; Jonathan Wage; Ilia Alshanetsky; Matteo
>Beccati; internals@lists.php.net; pdo; Ferenc Kovacs
>Subject: [PDO] Re: [PHP-DEV] [PATCH] New PDO methods for
>PostgreSQL driver
>
>
>Hi.
>
>It is similar to what I tried to do with the pgsql driver
>(look at my previous post).
>
>I could try to restore the old patch, compare with your and
>then re-test it.
>
>If this is the way to follow, then the optimal solution (?)
>would be to add a standard function to the pdo driver that
>translates the connection between old driver and PDO one
>(there could be some problems because of different same DMBS
>drivers (mysql, mysqli for example)).
>
>
>Denis
>
>
>----- Messaggio originale -----
>> Da: "Johannes Schlüter" <johan...@schlueters.de>
>> A: "Denis Gasparin" <denis.gaspa...@edistar.com>
>> Cc: "Pierre Joye" <pierre....@gmail.com>, "Jonathan Wage"
>> <jonw...@gmail.com>, "Ilia Alshanetsky" <i...@prohost.org>, "Matteo
>> Beccati" <p...@beccati.com>, internals@lists.php.net, "pdo"
>> <p...@lists.php.net>, "Ferenc Kovacs" <i...@tyrael.hu>
>> Inviato: Giovedì, 3 giugno 2010 22:19:57
>> Oggetto: Re: [PHP-DEV] [PATCH] New PDO methods for PostgreSQL driver
>
>> On Thu, 2010-06-03 at 21:48 +0200, Denis Gasparin wrote:
>> > As I wrote last week, according to me too the best
>solution would be
>> > to share the PDO opened connection between the old pgsql
>driver and
>> > the PDO one That was the original way we tried to develop the patch
>> > without success.
>>
>> Would be helpful to tell what your problem was.
>>
>> https://code.launchpad.net/~johannes-s/php-mysqlnd/pdo2mysqli is a
>> branch adding a pdo::toMysqli() method. I won't commit it to PHP in
>> that form but should be a good start. I don't know much about the
>> pgsql extension, but maybe it helps.
>>
>> johannes
>
>--
>PDO Working Group Mailing List (http://pdo.php.net)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to