X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C4B92D9F97 for ; Mon, 10 Oct 2005 23:11:45 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 45061-08 for ; Tue, 11 Oct 2005 02:11:41 +0000 (GMT) Received: from mail.nsasia.co.th (mail.nsasia.co.th [203.146.6.34]) by svr1.postgresql.org (Postfix) with ESMTP id BA03BD9FE6 for ; Mon, 10 Oct 2005 23:11:42 -0300 (ADT) Received: from [192.168.200.39] (helo=mail.nsasia.co.th) by astaro.nsasia.co.th with esmtp (Exim 4.43) id 1EP9cI-0007du-6t for pgsql-sql@postgresql.org; Tue, 11 Oct 2005 09:11:46 +0700 Received: from Thailand-MTA by mail.nsasia.co.th with Novell_GroupWise; Tue, 11 Oct 2005 09:11:31 +0700 Message-Id: <434B81B8.C5F7.004C.0@nsasia.co.th> X-Mailer: Novell GroupWise Internet Agent 7.0 Date: Tue, 11 Oct 2005 09:11:21 +0700 From: "Premsun Choltanwanich" To: "Richard Huxton" Cc: Subject: Re: How to delete Large Object from Database? References: <43465BAA.C5F7.004C.0@nsasia.co.th> <434623FD.7000408@archonet.com> <434A8F85.C5F7.004C.0@nsasia.co.th> <434A3D2F.90907@archonet.com> In-Reply-To: <434A3D2F.90907@archonet.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=__Part26042359.1__=" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.192 required=5 tests=[AWL=-0.072, HTML_30_40=0.056, HTML_MESSAGE=0.001, UPPERCASE_25_50=0.207] X-Spam-Level: X-Archive-Number: 200510/79 X-Sequence-Number: 22932 This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part26042359.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable The code that show below is refered to table and function that I use for = kept BLOB (LO). =20 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") )=20 WITH OIDS; ALTER TABLE t_data_pic OWNER TO admin; =20 CREATE OR REPLACE FUNCTION lo(oid) RETURNS lo AS '$libdir/lo', 'lo' LANGUAGE 'c' IMMUTABLE STRICT; ALTER FUNCTION lo(oid) OWNER TO postgres; =20 CREATE OR REPLACE FUNCTION oid(lo) RETURNS oid AS '$libdir/lo', 'lo_oid' LANGUAGE 'c' IMMUTABLE STRICT; ALTER FUNCTION oid(lo) OWNER TO postgres; =20 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; =20 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; =20 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; =20 >>> Richard Huxton 10-Oct-05 17:06:39 pm >>> Premsun Choltanwanich wrote: >=20 > The lib I use is call lo_in and lo_out for manage BLOB. > =20 > I understand that lo_unlink be related with lo_import and lo_export so = I=20 > 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=20 create the triggers. Could this be the case with your database? There are a couple of other=20 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 --=__Part26042359.1__= Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Description: HTML
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;
ALT= ER TABLE t_data_pic OWNER TO admin;
 

CREATE OR REPLACE FUNCTION lo(oid)
  RETURNS lo AS
'$li= bdir/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;
AL= TER FUNCTION oid(lo) OWNER TO postgres;
 

CREATE OR REPLACE FUNCTION lo_oid(lo)
  RETURNS oid = AS
'$libdir/lo', 'lo_oid'
  LANGUAGE 'c' IMMUTABLE STRICT;
AL= TER 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;
ALT= ER 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;
AL= TER 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.
>&nb= sp;
> 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
     &nb= sp; match
--=__Part26042359.1__=--