different results for large objects

From: c k <shreeseva(dot)learning(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org, pgsql-admin(at)postgresql(dot)org
Subject: different results for large objects
Date: 2009-03-17 11:56:44
Message-ID: d8e7a1e30903170456q767429dt4170f19662fbd2c9@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

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

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2009-03-17 12:43:05 Re: [GENERAL] different results for large objects
Previous Message adamr 2009-03-17 11:01:01 Re: Need help to restore database

Browse pgsql-general by date

  From Date Subject
Next Message Howard Cole 2009-03-17 12:02:11 Re: Postgres 8.2.x support on Windows 2008
Previous Message Craig Ringer 2009-03-17 11:47:29 Re: PostgreSQL versus MySQL for GPS Data