Re: reg:lseek&read ..pls

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: reg:lseek&read ..pls
Дата
Msg-id 9691.1135611507@sss.pgh.pa.us
обсуждение исходный текст
Ответ на reg:lseek&read ..pls  ("sandhya" <sandhyar@amiindia.co.in>)
Список 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

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

Предыдущее
От: Alain Rodriguez Arias
Дата:
Сообщение: Re: lo_ functions
Следующее
От: Tom Lane
Дата:
Сообщение: Re: vacuuming template0 gave ERROR