pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: sandhya <sandhyar@amiindia.co.in>
To: Postgres <pgsql-admin@postgresql.org>
Subject: Fw: pls help me
Date: Wed, 1 Mar 2006 17:26:38 +0530
Message-ID: <018201c63d27$34f26ec0$cd00000a@sandhyar> (raw)




Hi,

In my application i need to create a file dynamically and load it into DB.

So.....I have created one object at run time .....and trying to open it inorder to write the content into it.....
But lo_open is returning -1(-ve value).
where i am doing mistake pls tell me.

lobjId = lo_creat(conn, INV_READ | INV_WRITE);
if (lobjId == 0)
fprintf(stderr, "can't create large object\n");

lobj_fd = lo_open(conn, lobjId, INV_WRITE);
//My application failed at this point..what i am missing here ?
if (lobj_fd < 0)
{
fprintf(stderr, "can't open large object %d\n",lobjId);
}
lo_lseek(conn, lobj_fd, 0, SEEK_SET);
nwritten = 0;
len = strlen(szContent);
while (len - nwritten > 0)
{
nbytes = lo_write(conn, lobj_fd, szContent, len - nwritten);
nwritten += nbytes;
}

view thread (5+ messages)  latest in thread

Message-ID: <018201c63d27$34f26ec0$cd00000a@sandhyar>
Permalink:  ../018201c63d27$34f26ec0$cd00000a@sandhyar/
Also on:    postgresql.org/message-id/018201c63d27$34f26ec0$cd00000a@sandhyar

 · 

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: sandhyar@amiindia.co.in
  Subject: Re: Fw: pls help me
  In-Reply-To: <018201c63d27$34f26ec0$cd00000a@sandhyar>
  References: <018201c63d27$34f26ec0$cd00000a@sandhyar>

* 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