pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Explicitly rolling back transaction from within a C-Language function
2+ messages / 2 participants
[nested] [flat]

* Explicitly rolling back transaction from within a C-Language function
@ 2004-11-24 19:23 Mark Dilger <markdilger@yahoo.com>
  2004-11-24 19:53 ` Re: Explicitly rolling back transaction from within a C-Language function Michael Fuhr <mike@fuhr.org>
  0 siblings, 1 reply; 2+ messages in thread

From: Mark Dilger @ 2004-11-24 19:23 UTC (permalink / raw)
  To: 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 



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Explicitly rolling back transaction from within a C-Language function
  2004-11-24 19:23 Explicitly rolling back transaction from within a C-Language function Mark Dilger <markdilger@yahoo.com>
@ 2004-11-24 19:53 ` Michael Fuhr <mike@fuhr.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Fuhr @ 2004-11-24 19:53 UTC (permalink / raw)
  To: Mark Dilger <markdilger@yahoo.com>; +Cc: pgsql-sql

On Wed, Nov 24, 2004 at 11:23:30AM -0800, Mark Dilger wrote:

> 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.

See the "Reporting Errors Within the Server" documentation:

http://www.postgresql.org/docs/7.4/static/error-message-reporting.html

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2004-11-24 19:53 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-11-24 19:23 Explicitly rolling back transaction from within a C-Language function Mark Dilger <markdilger@yahoo.com>
2004-11-24 19:53 ` Michael Fuhr <mike@fuhr.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox