• PHP Manual
  • Function Reference
  • Database Extensions
  • Abstraction Layers
  • PDO
  • PDO Drivers
  • Pdo\Pgsql
  • Pdo\Pgsql::copyFromArray
  • Pdo\Pgsql::copyFromFile
  • Pdo\Pgsql::copyToArray
  • Pdo\Pgsql::copyToFile
  • Pdo\Pgsql::escapeIdentifier
  • Pdo\Pgsql::getNotify
  • Pdo\Pgsql::getPid
  • Pdo\Pgsql::lobCreate
  • Pdo\Pgsql::lobOpen
  • Pdo\Pgsql::lobUnlink
  • Pdo\Pgsql::setNoticeCallback
Pdo\Pgsql::lobOpen
Pdo\Pgsql::setNoticeCallback
Pdo\Pgsql
PHP Manual

Pdo\Pgsql::lobUnlink

Deletes the large object

Description

public bool Pdo\Pgsql::lobUnlink(string $oid)

Deletes a large object from the database identified by OID.

Note: This function, and all manipulations of the large object, must be called and carried out within a transaction.

Parameters

oid
A large object identifier.

Return Values

Returns true on success or false on failure.

Examples

Example #1 Pdo\Pgsql::lobUnlink example

This example unlinks a large object from the database prior to deleting the row that references it from the blobs table are used in the examples of Pdo\Pgsql::lobCreate and Pdo\Pgsql::lobOpen.

<?php
$db = new PDO('pgsql:dbname=test host=localhost', $user, $pass);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$db->beginTransaction();
$db->pgsqlLOBUnlink($oid);
$stmt = $db->prepare("DELETE FROM BLOBS where ident = ?");
$stmt->execute(array($some_id));
$db->commit();
?>

See Also

  • Pdo\Pgsql::lobCreate
  • Pdo\Pgsql::lobOpen
  • pg_lo_create
  • pg_lo_open