2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

データベースからすべてのラージオブジェクトを削除

Last updated at Posted at 2016-04-13

###SQL

TRUNCATE_LARGE_OBJECTS.sql
SELECT lo_unlink(l.oid) FROM pg_largeobject_metadata l;

###「pg_largeobject_metadata」とは

pg_largeobject_metadataはラージオブジェクトに関連したメタデータを保持します。 実際のラージオブジェクトデータはpg_largeobjectに格納されます。

###「lo_unlink()」とは

データベースからラージオブジェクトを削除する関数。引数はoid。

####参考資料(というかそのまま):
http://stackoverflow.com/questions/33138588/delete-all-large-objects-from-postgresql-database

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?