pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: sandhya <sandhyar@amiindia.co.in>
Cc: postgre <pgsql-admin@postgresql.org>
Subject: Re: reg:lseek&read ..pls
Date: Mon, 26 Dec 2005 10:38:27 -0500
Message-ID: <9691.1135611507@sss.pgh.pa.us> (raw)
In-Reply-To: <013501c609fa$57b48480$cd00000a@amiindiahjwbgh>
References: <013501c609fa$57b48480$cd00000a@amiindiahjwbgh>

"sandhya" <sandhyar@amiindia.co.in> 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



view thread (3+ messages)

Message-ID: <9691.1135611507@sss.pgh.pa.us>
Permalink:  ../9691.1135611507@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/9691.1135611507@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, sandhyar@amiindia.co.in
  Subject: Re: reg:lseek&read ..pls
  In-Reply-To: <9691.1135611507@sss.pgh.pa.us>
  References: <013501c609fa$57b48480$cd00000a@amiindiahjwbgh> <9691.1135611507@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox