By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,852 Members | 2,259 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,852 IT Pros & Developers. It's quick & easy.

SPI question: trying to read from Large Objects from within a function

P: n/a
What:
I'm having trouble finding out how to find the current PGconn
connection inside a C function. Looking through the documentation
didn't give this up. Could anyone suggest where to look?

Why:
I am writing an wrapper around librsync, allowing differential updating
of large amounts of data (librsync wraps the clever algorithm of
rsync).

The first function I'm wrapping is the one which generates a signature
(a hash of each block of data, with some specified block-size) from a
LO. Its signature would be:

create function rsync_signature(oid /* of an Large Object */) returns
bytea

But I can't figure out how to get the current PGconn to be able to run
the lo_* functions.
Would it btw be possible to avoid using Large Objects, and use TOAST
columns instead? Ie. is it possible to quickly read/write partial toast
columns (I know it's not possible for clients, but on the server
side?).
There may be more questions later, but I'll try to pay back by
submitting the final implementation to contrib/ (if anyone is
interested). It'll allow for really fast incremental updates of a
columns, which I'll use to make storing of huge blobs less of a pain
(although it depends on the client also speaking rsync-ese, but that'll
be included with the package).
Regards,

d.
--
David Helgason
Over the Edge Entertainments
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.