Re: How to delete Large Object from Database?

Поиск
Список
Период
Сортировка
От Premsun Choltanwanich
Тема Re: How to delete Large Object from Database?
Дата
Msg-id 434B81B8.C5F7.004C.0@nsasia.co.th
обсуждение исходный текст
Ответ на Re: How to delete Large Object from Database?  (Richard Huxton <dev@archonet.com>)
Ответы Re: How to delete Large Object from Database?
Список 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 по дате отправления:

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: How to delete Large Object from Database?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: How to delete Large Object from Database?