Here's a patch to add pgsqlGetCopyData, pgsqlPutCopyData, and
pgsqlEndCopyData
methods. I opened bug #50092 but I don't seem able to attach the patch,
so I attached it here.
--Tim
Tim Ringenbach wrote:
Here's a patch to add pgsqlGetCopyData, pgsqlPutCopyData, and
pgsqlEndCopyData
methods. I opened bug #50092 but I don't seem able to attach the patch,
so I attached it here.--Tim
What do these do? I.e. where's the documentation or RFC http://wiki.php.net/rfc ? :)
So the patch can be found easily, can you update the bug with a link to it?
Chris
--
Blog: http://blogs.oracle.com/opal
Twitter: http://twitter.com/ghrd
What do these do? I.e. where's the documentation or RFC http://wiki.php.net/rfc ? :)
So the patch can be found easily, can you update the bug with a link to it?
I updated the bug with a link to the list archives.
I'm not familiar with http://wiki.php.net/rfc. README.SUBMITTING_PATCH
didn't mention anything about it, or really anything about
documentation. Should I just tell you, or is there something special I
should do? Most of the things on the rfc look like much bigger changes
than this.
Apparently Ilia Alshanetsky's the maintaining, so I'm CCing them. The
version I started working on said unknown, and I didn't think to check
again when I switch to subversion.
Those functions are basically php wrappers around the 3 similarly named
functions found on http://www.postgresql.org/docs/8.1/static/libpq-copy.html
You issue a COPY TO STDOUT
query and then run pgsqlGetCopyData until it
returns false.
Or you issue a COPY TO STDIN
query and calld pgsqlPutCopyData repeatedly
to send your data, then pgsqlPutCopyEnd when you're done.
Example php code:
$db = new PDO($dsn, $user, $pass, $driver_options);
$db->query("COPY users TO STDIN WITH CSV");
while (($ret = $db->pgsqlGetCopyData()) !== false)
echo "x: $ret\n";
$db->query("COPY test FROM STDIN WITH CSV");
$db->pgsqlPutCopyData("1,blah\n");
$db->pgsqlPutCopyData("2,asdf\n");
$db->pgsqlPutCopyEnd();
hi,
Here's a patch to add pgsqlGetCopyData, pgsqlPutCopyData, and
pgsqlEndCopyData
methods. I opened bug #50092 but I don't seem able to attach the patch, so I
attached it here.
Please see the current discussion on the PDO mailing list. It is not
certain that we like to go down the driver specific method (I'm, for
one, against this idea). That does not mean that the feature cannot be
added, but maybe not this way.
Cheers,
Pierre