Reg:lo_open error..pls help me

Поиск
Список
Период
Сортировка
От sandhya
Тема Reg:lo_open error..pls help me
Дата
Msg-id 01b701c63d2a$4d640880$cd00000a@sandhyar
обсуждение исходный текст
Ответ на Fw: pls help me  ("sandhya" <sandhyar@amiindia.co.in>)
Ответы Re: Reg:lo_open error..pls help me  (Michael Fuhr <mike@fuhr.org>)
Re: Reg:lo_open error..pls help me  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-admin
Is it possible to use lo_open after creating the object while the application is running?
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;
}

В списке pgsql-admin по дате отправления:

Предыдущее
От: "sandhya"
Дата:
Сообщение: Fw: pls help me
Следующее
От: Tom Lane
Дата:
Сообщение: Re: REINDEX during a transaction