5

Currently i am using PostgreSQL Plus Advance Server 9.3 and i just created a table which has a column of blob type and i am using oid data type to store blob value.

Now i want to create a BEFORE UPDATE AND DELETE TRIGGER to remove the orphan data from pg_largeobject table of postgresql using:

CREATE TRIGGER DEL_OID BEFORE UPDATE OR DELETE ON INFO_LOB
 FOR EACH ROW EXECUTE PROCEDURE lo_manage (BLOB_VALUE_);

But when i am trying to execute this trigger, Getting error:

ERROR: function lo_manage() does not exist
SQL state: 42883

so i am not able to understand that what is the mistake that i am doing. can somebody please help me? thanks

pozs
  • 34,608
  • 5
  • 57
  • 63
Krishna
  • 795
  • 2
  • 7
  • 24
  • 6
    `lo_manage()` function is added with the `lo` contrib module. http://www.postgresql.org/docs/current/static/lo.html -- have you added this module by executing `CREATE EXTENSION lo;` ? – pozs May 20 '14 at 12:13
  • 1
    What pozs wrote, or you don't have the schema where the extension is installed in your [`search_path`](http://stackoverflow.com/questions/9067335/how-to-create-table-inside-specific-schema-by-default-in-postgres/9067777#9067777). – Erwin Brandstetter May 20 '14 at 12:30
  • Hi @pozs thanks for your reply, i got my answer, actually i don't have created the extension, now it is working. – Krishna May 20 '14 at 12:36
  • 1
    Related: http://stackoverflow.com/questions/3862648/how-to-use-install-dblink-in-postgresql/13264961#13264961, http://stackoverflow.com/questions/9025515/how-do-i-import-modules-or-install-extensions-in-postgresql-9-1-9-2-9-3-9-4/9025551 – Erwin Brandstetter May 20 '14 at 18:40

0 Answers0