Re: Limit on updates made in a transaction

From: Darren Ferguson <darren(at)crystalballinc(dot)com>
To: Kent Tong <kent(at)cpttm(dot)org(dot)mo>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Limit on updates made in a transaction
Date: 2002-07-29 12:41:34
Message-ID: Pine.LNX.4.44.0207290840120.31284-100000@thread.crystalballinc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Use transactions

If you have it stored in a transaction you can rollback the whole
transaction on any error

Begin;

INSERT INTO foo VALUES ('bar');
INSERT INTO foo's VALUES ('bar'); <-- produce error

Rollback;

Now foo will not have the row bar in it

HTH

On 26 Jul 2002, Kent Tong wrote:

> Hi,
>
> Is there is any limit on the number of updates made to a
> postgreSQL database in a single transaction? If yes, how
> can we get around this problem? For example, we need to
> update a field of many existing rows in a table triggered
> by the addition of a new row. If anything fails in the
> update process, we'd like to undone everything (including
> the addition of the new row).
>
> Thanks in advance for any info!
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>

--
Darren Ferguson

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Sullivan 2002-07-29 12:44:13 Re: log sql?
Previous Message Tourtounis Sotiris 2002-07-29 12:35:31 Problematic Index Scan