pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
reg:lseek&read ..pls
3+ messages / 2 participants
[nested] [flat]

* reg:lseek&read ..pls
@ 2005-12-26 08:57 sandhya <sandhyar@amiindia.co.in>
  2005-12-26 15:38 ` Re: reg:lseek&read ..pls Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: sandhya @ 2005-12-26 08:57 UTC (permalink / raw)
  To: pgsql-admin; +Cc: sandhya <sandhyar@amiindia.co.in>

hi......

I stored few files into the database and trying to open it while accessing webserver...
In that case i need to just read the contents of the large object.
So...After importing all the files into the database i am trying to read the contents of the object.
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?

void
pickout(PGconn *conn, Oid lobjId, int start, int len)

I used the above sample one which is in postgres document.
Here i am mentioning the Oid and start as 0 and len as 2000.....But i am unable to get the whole contents of the file.
If i want to get entire file contents...How to do?
What len i need to specify?
Is there any thing to know the size of the object?
Please tell me..............

Thank you
-Sandhya

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: reg:lseek&read ..pls
  2005-12-26 08:57 reg:lseek&read ..pls sandhya <sandhyar@amiindia.co.in>
@ 2005-12-26 15:38 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2005-12-26 15:38 UTC (permalink / raw)
  To: sandhya <sandhyar@amiindia.co.in>; +Cc: pgsql-admin

"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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Fw: reg:lseek&read ..pls
@ 2005-12-26 10:57 sandhya <sandhyar@amiindia.co.in>
  0 siblings, 0 replies; 3+ messages in thread

From: sandhya @ 2005-12-26 10:57 UTC (permalink / raw)
  To: pgsql-admin


----- Original Message ----- 
From: sandhya 
To: postgre 
Cc: sandhya 
Sent: Monday, December 26, 2005 2:27 PM
Subject: reg:lseek&read ..pls


hi......

I stored few files into the database and trying to open it while accessing webserver...
In that case i need to just read the contents of the large object.
So...After importing all the files into the database i am trying to read the contents of the object.
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?

void
pickout(PGconn *conn, Oid lobjId, int start, int len)

I used the above sample one which is in postgres document.
Here i am mentioning the Oid and start as 0 and len as 2000.....But i am unable to get the whole contents of the file.
If i want to get entire file contents...How to do?
What len i need to specify?
Is there any thing to know the size of the object?
Please tell me..............

Thank you
-Sandhya

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2005-12-26 15:38 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-12-26 08:57 reg:lseek&read ..pls sandhya <sandhyar@amiindia.co.in>
2005-12-26 15:38 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-12-26 10:57 Fw: reg:lseek&read ..pls sandhya <sandhyar@amiindia.co.in>

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