vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I've got some server functions that were previously written using libpq. They work fine. However because they need to open their own connection to insert into tables and write into large objects, etc, they aren't transaction safe. That is to say, if a user starts a transaction, executes my functions, and then tries to abort or roll back the transaction, nothing will happen because the work was done in a different connection. Now I'm trying to make the functions transaction safe. In theory, all I need to do is convert my libpq calls to equivalent SPI calls. However, there don't appear to be any SPI equivalents for the large object functions like lo_write and lo_read. Relying on the Toaster mechanism is not an option as my data sizes are too large to fit in memory. Am I correct in believing that large objects can not be directly handled by a server function in a transaction safe manner? Thank you Eric. ********************************************** Eric Davies, M.Sc. Barrodale Computing Services Ltd. Tel: (250) 472-4372 Fax: (250) 472-4373 Web: http://www.barrodale.com Email: eric@barrodale.com ********************************************** Mailing Address: P.O. Box 3075 STN CSC Victoria BC Canada V8W 3W2 Shipping Address: Hut R, McKenzie Avenue University of Victoria Victoria BC Canada V8W 3W2 ********************************************** |
| ||||
| Eric Davies <Eric@barrodale.com> writes: > Now I'm trying to make the functions transaction safe. In theory, all > I need to do is convert my libpq calls to equivalent SPI calls. > However, there don't appear to be any SPI equivalents for the large > object functions like lo_write and lo_read. What do you need SPI for? Call the functions directly. See src/include/libpq/be-fsstubs.h src/backend/libpq/be-fsstubs.c regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq |