different results for large objects - Mailing list pgsql-admin

From c k
Subject different results for large objects
Date
Msg-id d8e7a1e30903170456q767429dt4170f19662fbd2c9@mail.gmail.com
Whole thread Raw
Responses Re: [GENERAL] different results for large objects  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-admin
I am getting correct results with following query i.e. binary objects as they are inserted.

select docimages.* from docimages where docimages.accobjecttype=9 ORDER BY docimages.docimagename;

but when I created a function as follows, binary objects are not shown, rather a number represting the large object on the server is shown.

CREATE OR REPLACE FUNCTION software.uf_searchdocimages(integer, integer, integer)
  RETURNS SETOF docimages AS
$BODY$
--select images for all object of specified type
    select docimages.* from docimages where docimages.accobjecttype= $2 ORDER BY docimages.docimagename;
$BODY$
  LANGUAGE 'sql' VOLATILE SECURITY DEFINER
  COST 1
  ROWS 10;

The problem is arising for a field of type 'lo'. Why this function is not giving the actual large object?
I am using Windows XP sp3, PostgreSQL 8.3.6.

The table definitions is like below-
CREATE TABLE docimages
(
  diid serial NOT NULL,
  docimagename character varying(50),
  docimage lo,
  accobjectid integer,
  accobjecttype integer,
  CONSTRAINT pk_docimages PRIMARY KEY (diid)
)
WITH (OIDS=FALSE);
Please reply.
Thanks in adavnce.
CPKulkarni

pgsql-admin by date:

Previous
From:
Date:
Subject: Re: Need help to restore database
Next
From: Tom Lane
Date:
Subject: Re: [GENERAL] different results for large objects