Hey ChoonSoo, 2012/1/6 ChoonSoo Park <luisp...@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.