Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id DAEB86338AC; Tue, 17 Mar 2009 08:56:48 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 78648-04; Tue, 17 Mar 2009 08:56:39 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.178]) by mail.postgresql.org (Postfix) with ESMTP id AE0F163259C; Tue, 17 Mar 2009 08:56:46 -0300 (ADT) Received: by wa-out-1112.google.com with SMTP id n4so2265265wag.19 for ; Tue, 17 Mar 2009 04:56:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=qgFIZUSq+6anY/Gf+igNwT5CHPh63RzyN71mBMR3pTI=; b=aKIW/RQJsImiSgnOC0N4G9HiDT8E7J1WVs54hHxGSjWTTGAdPyNGWqHebo6yZHwVLt BrLLWfmgBq4oBOEFJRIrzYKVG8pOr6Dtp8SBGZBNLsXs5yjuIpxKxydJi1c9xBp8vJpZ wBHswISMSgvHUZq4eapqZgYp+swcE7gOyYEGk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=ALfzucH9oGluMZr4+Vvrgf3rNrR1XLWptE8GZ81NEXEXitbhUwprAfafxbiyUbCMpY X207n5AVu8Iu2WE1GvEfsGV2hEMyh353ejPV1pEXGpN+6F8Ska7/L0ADZL0JeQ7A6eN4 /HVLIL9LJSGYMbCCyvt/LLOlMGwpDRA2cjAHU= MIME-Version: 1.0 Received: by 10.114.184.7 with SMTP id h7mr4205619waf.151.1237291004428; Tue, 17 Mar 2009 04:56:44 -0700 (PDT) Date: Tue, 17 Mar 2009 17:26:44 +0530 Message-ID: Subject: different results for large objects From: c k To: pgsql-general@postgresql.org, pgsql-admin@postgresql.org Content-Type: multipart/alternative; boundary=00163646d90ccd809604654f4269 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200903/184 X-Sequence-Number: 31684 --00163646d90ccd809604654f4269 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 --00163646d90ccd809604654f4269 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I am getting correct results with following query i.e. binary objects as th= ey are inserted.

select docimages.* from docimages where docimages.a= ccobjecttype=3D9 ORDER BY docimages.docimagename;

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

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

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

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