Re: How to delete Large Object from Database? - Mailing list pgsql-sql

From Premsun Choltanwanich
Subject Re: How to delete Large Object from Database?
Date
Msg-id 434B81B8.C5F7.004C.0@nsasia.co.th
Whole thread Raw
In response to Re: How to delete Large Object from Database?  (Richard Huxton <dev@archonet.com>)
Responses Re: How to delete Large Object from Database?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
The code that show below is refered to table and function that I use for kept BLOB (LO).
 
CREATE TABLE t_data_pic
(
  "sysid" bigserial NOT NULL,
  data_sysid int8 NOT NULL,
  data_pic lo,
  CONSTRAINT t_data_pic_pkey PRIMARY KEY ("sysid")
)
WITH OIDS;
ALTER TABLE t_data_pic OWNER TO admin;
 

CREATE OR REPLACE FUNCTION lo(oid)
  RETURNS lo AS
'$libdir/lo', 'lo'
  LANGUAGE 'c' IMMUTABLE STRICT;
ALTER FUNCTION lo(oid) OWNER TO postgres;
 

CREATE OR REPLACE FUNCTION oid(lo)
  RETURNS oid AS
'$libdir/lo', 'lo_oid'
  LANGUAGE 'c' IMMUTABLE STRICT;
ALTER FUNCTION oid(lo) OWNER TO postgres;
 

CREATE OR REPLACE FUNCTION lo_oid(lo)
  RETURNS oid AS
'$libdir/lo', 'lo_oid'
  LANGUAGE 'c' IMMUTABLE STRICT;
ALTER FUNCTION lo_oid(lo) OWNER TO postgres;
 

CREATE OR REPLACE FUNCTION lo_in(cstring)
  RETURNS lo AS
'$libdir/lo', 'lo_in'
  LANGUAGE 'c' IMMUTABLE STRICT;
ALTER FUNCTION lo_in(cstring) OWNER TO postgres;
 

CREATE OR REPLACE FUNCTION lo_out(lo)
  RETURNS cstring AS
'$libdir/lo', 'lo_out'
  LANGUAGE 'c' IMMUTABLE STRICT;
ALTER FUNCTION lo_out(lo) OWNER TO postgres;
 


>>> Richard Huxton <dev@archonet.com> 10-Oct-05 17:06:39 pm >>>
Premsun Choltanwanich wrote:
>
> The lib I use is call lo_in and lo_out for manage BLOB.

> I understand that lo_unlink be related with lo_import and lo_export so I
> don't think that it work.

If you are using the contrib/lo library, then README.lo mentions:

* Some frontends may create their own tables, and will not create the
   associated trigger(s). Also, users may not remember (or know) to
create the triggers.

Could this be the case with your database? There are a couple of other
points in the README.lo that are worth checking too.

--
   Richard Huxton
   Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

pgsql-sql by date:

Previous
From: Richard Huxton
Date:
Subject: Re: How to delete Large Object from Database?
Next
From: Tom Lane
Date:
Subject: Re: How to delete Large Object from Database?