hi,

is there any easy way to issue large object operations like lo_write,
or more generally fast-path calls, asynchronously? (async in the sense
of PQsendQuery so that i can poll to wait a result)

background: i want to use multiple connections to the server in a single
application for performance reasons. the application is single-threaded.
(multi threading is not possible because i need to use a
pthread-incompatible library.)
using synchronous api when another asynchronous command is in-progress is
deadlock-prone as i can't receive the result of asynchronous one until
the synchronous one finishes.

YAMAMOTO Takashi

Search Discussions

  • YAMAMOTO Takashi at Jan 15, 2011 at 1:18 pm
    hi,

    i workarounded this by using PQsendQuery with eg. "select lowrite($1,$2)".
    while it seems to work, i wonder if it's ok to use these functions this way,
    given that only some of large object server-side functions are documented
    in http://www.postgresql.org/docs/9.0/interactive/lo-funcs.html.

    YAMAMOTO Takashi
    hi,

    is there any easy way to issue large object operations like lo_write,
    or more generally fast-path calls, asynchronously? (async in the sense
    of PQsendQuery so that i can poll to wait a result)

    background: i want to use multiple connections to the server in a single
    application for performance reasons. the application is single-threaded.
    (multi threading is not possible because i need to use a
    pthread-incompatible library.)
    using synchronous api when another asynchronous command is in-progress is
    deadlock-prone as i can't receive the result of asynchronous one until
    the synchronous one finishes.

    YAMAMOTO Takashi
  • Josh Kupershmidt at Jan 16, 2011 at 5:16 pm

    On Sat, Jan 15, 2011 at 8:17 AM, YAMAMOTO Takashi wrote:
    hi,

    i workarounded this by using PQsendQuery with eg. "select lowrite($1,$2)".
    while it seems to work, i wonder if it's ok to use these functions this way,
    given that only some of large object server-side functions are documented
    in http://www.postgresql.org/docs/9.0/interactive/lo-funcs.html.
    lo_write() is documented here:
    http://www.postgresql.org/docs/current/static/lo-interfaces.html#LO-WRITE

    I think it's not on the page you linked to because it is not callable
    via SQL, only via libpq.

    Josh
  • YAMAMOTO Takashi at Jan 16, 2011 at 11:58 pm
    hi,
    On Sat, Jan 15, 2011 at 8:17 AM, YAMAMOTO Takashi
    wrote:
    hi,

    i workarounded this by using PQsendQuery with eg. "select lowrite($1,$2)".
    while it seems to work, i wonder if it's ok to use these functions this way,
    given that only some of large object server-side functions are documented
    in http://www.postgresql.org/docs/9.0/interactive/lo-funcs.html.
    lo_write() is documented here:
    http://www.postgresql.org/docs/current/static/lo-interfaces.html#LO-WRITE

    I think it's not on the page you linked to because it is not callable
    via SQL, only via libpq.
    why not? will it likely be changed for future versions in an
    incompatible manner? connecting to a newer server using an old libpq
    is not supported either?

    YAMAMOTO Takashi
    Josh

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-novice @
categoriespostgresql
postedJan 13, '11 at 12:21a
activeJan 16, '11 at 11:58p
posts4
users2
websitepostgresql.org
irc#postgresql

People

Translate

site design / logo © 2022 Grokbase