1 # pq\LOB pq\Transaction::createLOB([int $mode = pq\LOB::RW])
3 Create a new *large object* and open it.
4 See pq\Transaction::openLOB().
8 * Optional int $mode = pq\LOB::RW
9 How to open the *large object* (read, write or both; see pq\LOB constants).
13 * pq\LOB, instance of the new *large object*.
17 * pq\Exception\InvalidArgumentException
18 * pq\Exception\BadMethodCallException
19 * pq\Exception\RuntimeException
25 $connection = new pq\Connection;
26 $transaction = $connection->startTransaction();
28 $lob = $transaction->createLOB();
29 $lob->write("Hello World!");
31 // close the LOB before unlinking
35 $transaction->unlinkLOB($oid);
36 $transaction->commit();