Skip site navigation (1) Skip section navigation (2)

Explicitly rolling back transaction from within a C-Language function

From: Mark Dilger <markdilger(at)yahoo(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Explicitly rolling back transaction from within a C-Language function
Date: 2004-11-24 19:23:30
Message-ID: 20041124192330.5327.qmail@web52804.mail.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-sql
Hello,

I have a transactional system built on top of
BerkeleyDB which I would like to call from within
Postgres through a C-Language function.  The behavior
of the function will be read-only.  Even so, the
BerkeleyDB-based system's transaction will sometimes
fail.  What I would like to do is propogate that
transactional failure into the Postgres transaction
that called the C-Language function.  Is this
possible?

To clarify what I think I want:  I would like the
C-Language function to return an error condition to
Postgres that will cause the current Postgres
transaction to abort.  I do not know how to do this.

I am not particularly worried about needing to
rollback the BerkeleyDB transaction when the Postgres
transaction fails, because the BerkeleyDB transaction
was read-only anyway, and there are no updates to roll
back.  However, I might want to do this in the future
so information on this subject is also welcome.

Thank you for any help,

mark


		
__________________________________ 
Do you Yahoo!? 
The all-new My Yahoo! - What will yours do?
http://my.yahoo.com 

Responses

pgsql-sql by date

Next:From: Michael FuhrDate: 2004-11-24 19:53:27
Subject: Re: Explicitly rolling back transaction from within a C-Language function
Previous:From: Alberto PiaDate: 2004-11-24 16:28:18
Subject: Encrypt data type LO

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group