vacuumlo

用于删除孤立大对象的 contrib 模块

vacuumlo 是一个 contrib 模块,提供了一个实用程序,用于删除孤立的 大对象

vacuumloPostgreSQL 6.5 中添加。

变更历史

请注意,在 PostgreSQL 9.2 中添加的 -l 选项也向后移植到了 PostgreSQL 9.0 (9.0.8) 和 PostgreSQL 9.1 (9.1.4)。

示例

移除与表无关的大对象

$ psql -c '\dl'
              Large objects
  ID   |  Owner   |     Description
-------+----------+----------------------
 16459 | postgres | A small large object
(1 row)

$ vacuumlo -n postgres
Connected to database "postgres"
Test run: no large objects will be removed!
Would remove 1 large objects from database "postgres".

$ vacuumlo postgres

$ psql -c '\dl'
      Large objects
 ID | Owner | Description
----+-------+-------------
(0 rows)

尝试移除与表相关的大对象

postgres=# CREATE TABLE lo_test (id SERIAL PRIMARY KEY, lo_oid OID);
CREATE TABLE

postgres=# \lo_import /tmp/hello-world.txt
lo_import 16479

postgres=# INSERT INTO lo_test VALUES (DEFAULT, 16479);
INSERT 0 1

postgres=# \q

$ vacuumlo -n postgres
Connected to database "postgres"
Test run: no large objects will be removed!
Checking lo_oid in public.lo_test
Would remove 0 large objects from database "postgres".

分类

Contrib 模块, 大对象, Vacuuming

另请参阅

大对象, lo

反馈

提交关于 "vacuumlo" 的任何评论、建议或更正请点击 此处