X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E3DFA3A3F98 for ; Wed, 24 Nov 2004 19:23:36 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 45263-03 for ; Wed, 24 Nov 2004 19:23:33 +0000 (GMT) Received: from web52804.mail.yahoo.com (web52804.mail.yahoo.com [206.190.39.168]) by svr1.postgresql.org (Postfix) with SMTP id 549833A3EF9 for ; Wed, 24 Nov 2004 19:23:31 +0000 (GMT) Received: (qmail 5329 invoked by uid 60001); 24 Nov 2004 19:23:30 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=LDEjQFyy5ULQAU0lBqSBo1K2dk34uq4NsP9j056+srNOuD7xdSHPw4Lp6E0PZpp/dSMQxVHJNgbboDydsUJKsW1VRImwY2hcPTJmu8OH7aDONyiAyyw2sQb/kWiVWp7wGRk4XP9XqZAKMJDPnKmku6yl3sbji70vbcmPyYxEe88= ; Message-ID: <20041124192330.5327.qmail@web52804.mail.yahoo.com> Received: from [206.129.116.197] by web52804.mail.yahoo.com via HTTP; Wed, 24 Nov 2004 11:23:30 PST Date: Wed, 24 Nov 2004 11:23:30 -0800 (PST) From: Mark Dilger Subject: Explicitly rolling back transaction from within a C-Language function To: pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/251 X-Sequence-Number: 19570 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