X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 3275F9DC883 for ; Mon, 26 Dec 2005 11:38:36 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 81025-04 for ; Mon, 26 Dec 2005 10:38:40 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id DC11A9DC881 for ; Mon, 26 Dec 2005 11:38:33 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id jBQFcRQL009692; Mon, 26 Dec 2005 10:38:32 -0500 (EST) To: "sandhya" cc: "postgre" Subject: Re: reg:lseek&read ..pls In-reply-to: <013501c609fa$57b48480$cd00000a@amiindiahjwbgh> References: <013501c609fa$57b48480$cd00000a@amiindiahjwbgh> Comments: In-reply-to "sandhya" message dated "Mon, 26 Dec 2005 14:27:04 +0530" Date: Mon, 26 Dec 2005 10:38:27 -0500 Message-ID: <9691.1135611507@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.045 required=5 tests=[AWL=0.045] X-Spam-Score: 0.045 X-Spam-Level: X-Archive-Number: 200512/311 X-Sequence-Number: 20031 "sandhya" writes: > But before that i need to know the size of the object from which i am = > trying to get the contents. > How can i do this? Same way you'd do it for a Unix file: seek to the end, note the end offset, seek back to the start and read. ... lo_open ... lo_size = lo_lseek(conn, fd, 0, SEEK_END); // where's the end? lo_lseek(conn, fd, 0, SEEK_SET); // go back to start regards, tom lane