From: patrick <patrick+pgsql@boxsoft.com>
To: Raj Mathur <raju@linux-delhi.org>
Cc: pgsql-sql@postgresql.org
Subject: Re: DBD::Pg transaction issues
Date: Mon, 7 Apr 2003 01:59:56 -0700
Message-ID: <20030407015956.C18107@3eye.boxsoft.com> (raw)
In-Reply-To: <16017.14581.156730.440857@mail.linux-delhi.org>
References: <16016.65329.971768.399349@mail.linux-delhi.org>
<200304071245.28635.mallah@trade-india.com>
<16017.14581.156730.440857@mail.linux-delhi.org>
On Mon, Apr 07, 2003 at 02:08:13PM +0530, Raj Mathur wrote:
> Rajesh> In perl-DBI eval is gnerally used for catching such SQLs
> Rajesh> without aborting the program.
>
> Am using eval's, but the transaction gets aborted in any case. The
> eval is only useful for my program to trap the error. I'm trying to
> find out how I can prevent the transaction mechanism from treating
> errors on the database as logical errors.
>
> So is there no way to prevent PostgreSQL (or DBI) from aborting the
> current transaction if an operation on the database fails?
One thing you may consider is to insert your new records into a temp
table first. Then when your program decides whether it should
"commit" then move the values from the temp table to your target
table, otherwise discard the entries in the temp table.
Hope this helps,
sidster
--
They who would sacrifice freedom for security will have neither.
-Ben Franklin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: patrick+pgsql@boxsoft.com, raju@linux-delhi.org
Subject: Re: DBD::Pg transaction issues
In-Reply-To: <20030407015956.C18107@3eye.boxsoft.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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