Re: How to code lo_creat & lo_write & lo_read in non-blocking mode

Поиск
Список
Период
Сортировка
От Dmitriy Igrishin
Тема Re: How to code lo_creat & lo_write & lo_read in non-blocking mode
Дата
Msg-id CAAfz9KOWvCy+D9LdDjgZQ4KRy15oDa8b8Ust4S9_qOAS51b79g@mail.gmail.com
обсуждение исходный текст
Ответ на How to code lo_creat & lo_write & lo_read in non-blocking mode  (ChoonSoo Park <luispark@gmail.com>)
Ответы Re: How to code lo_creat & lo_write & lo_read in non-blocking mode  (ChoonSoo Park <luispark@gmail.com>)
Список pgsql-general
Hey ChoonSoo,

2012/1/6 ChoonSoo Park <luispark@gmail.com>
I just wonder if there is a way to program lo client interfaces (lo_creat, lo_write, lo_read) in non-blocking mode.
PQsendQueryParams works perfect for executing a sql command in non-blocking mode. But I couldn't find a way for handling large objects.
These functions uses obsolete fast-path interface to call
these functions on the backend:
dmitigr=> select oid, proname from pg_proc where proname ~ E'^lo_' or proname in ('loread', 'lowrite');
 oid  |   proname  
------+-------------
  764 | lo_import
  767 | lo_import
  765 | lo_export
  952 | lo_open
  953 | lo_close
  954 | loread
  955 | lowrite
  956 | lo_lseek
  957 | lo_creat
  715 | lo_create
  958 | lo_tell
 1004 | lo_truncate
  964 | lo_unlink
(13 rows)

So, you can call these functions using regular SQL
(prepared statements may be used for improving
performance in this case).

Do you have any example?
I can't imagine how (and why) to work with LOs
in asynchronous mode because LOs stored as a
sequence of chunks (the size is usually 4kb)
of the type bytea in the special table. As consequence all
operations on the LOs must be inside an explicitly opened
transaction block.

Thank you,
Choon Park



--
// Dmitriy.


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

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: URGENT: temporary table not recognized?
Следующее
От: Jason Buberel
Дата:
Сообщение: Time to move table to new tablespace