|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-11-30 12:06 UTC] ch@php.net
Description:
------------
Several PostgreSQL specific PDO methods are not documented although they do work fine.
Although PDO aims to hide database specific features behind a common API, sometimes one simply wants to use certain features and for this reason they should not be hidden but rather documented (with a proper warning).
php5-5.4.4$ grep -B2 PHP_METHOD ext/pdo_pgsql/pgsql_driver.c
/* {{{ proto string PDO::pgsqlCopyFromArray(string $table_name , array $rows [, string $delimiter [, string $null_as ] [, string $fields])
Returns true if the copy worked fine or false if error */
static PHP_METHOD(PDO, pgsqlCopyFromArray)
--
/* {{{ proto string PDO::pgsqlCopyFromFile(string $table_name , string $filename [, string $delimiter [, string $null_as ] [, string $fields])
Returns true if the copy worked fine or false if error */
static PHP_METHOD(PDO, pgsqlCopyFromFile)
--
/* {{{ proto string PDO::pgsqlCopyToFile(string $table_name , $filename, [string $delimiter [, string $null_as [, string $fields]]])
Returns true if the copy worked fine or false if error */
static PHP_METHOD(PDO, pgsqlCopyToFile)
--
/* {{{ proto string PDO::pgsqlCopyToArray(string $table_name , [string $delimiter [, string $null_as [, string $fields]]])
Returns true if the copy worked fine or false if error */
static PHP_METHOD(PDO, pgsqlCopyToArray)
--
/* {{{ proto string PDO::pgsqlLOBCreate()
Creates a new large object, returning its identifier. Must be called inside a transaction. */
static PHP_METHOD(PDO, pgsqlLOBCreate)
--
/* {{{ proto resource PDO::pgsqlLOBOpen(string oid [, string mode = 'rb'])
Opens an existing large object stream. Must be called inside a transaction. */
static PHP_METHOD(PDO, pgsqlLOBOpen)
--
/* {{{ proto bool PDO::pgsqlLOBUnlink(string oid)
Deletes the large object identified by oid. Must be called inside a transaction. */
static PHP_METHOD(PDO, pgsqlLOBUnlink)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 09:00:02 2026 UTC |
Here's an example for reusing a doctrine connection (and db transaction) for the COPY via PDO: $file = '/tmp/test.csv'; $this->manager->getConnection()->beginTransaction(); // ... do something in doctrine here $pdo = $this->manager->getConnection()->getWrappedConnection(); $pdo->pgsqlCopyFromFile('testtable', $file, "\t", '', 'field1, field2'); $this->manager->getConnection()->commit();