array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.pg-lo-unlink.php', 1 => 'pg_lo_unlink', ), 'up' => array ( 0 => 'ref.pgsql.php', 1 => 'PostgreSQL 函数', ), 'prev' => array ( 0 => 'function.pg-lo-truncate.php', 1 => 'pg_lo_truncate', ), 'next' => array ( 0 => 'function.pg-lo-write.php', 1 => 'pg_lo_write', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/pgsql/functions/pg-lo-unlink.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)
pg_lo_unlink — 删除一个大型对象
pg_lo_unlink() 删除由 oid
指定的大型对象。成功时返回 true
, 或者在失败时返回 false
。
要使用大型对象(lo)接口,需要将其放置在事务块中。
注意:
本函数以前的名字为 pg_lounlink()。
connection
An PgSql\Connection instance.
When connection
is unspecified, the default connection is used.
The default connection is the last connection made by pg_connect()
or pg_pconnect().
As of PHP 8.1.0, using the default connection is deprecated.
oid
数据库中大对象的 OID。
版本 | 说明 |
---|---|
8.1.0 |
现在 connection 参数接受 PgSql\Connection
实例,之前接受 resource。
|
示例 #1 pg_lo_unlink() 示例
<?php
// 要删除的大对象的 OID
$doc_oid = 189762345;
$database = pg_connect("dbname=jacarta");
pg_query($database, "begin");
pg_lo_unlink($database, $doc_oid);
pg_query($database, "commit");
?>