vacuumlo

用于移除孤立大对象的 Contrib 模块

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

vacuumlo 添加于 PostgreSQL 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 模块大对象真空清理

另请参阅

大对象lo

反馈

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