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

Re: [HACKERS] Continue transactions after errors in psql

From: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] Continue transactions after errors in psql
Date: 2005-04-27 12:02:21
Message-ID: 8a3f483153bb6f01e5d2fe0594abf374@biglumber.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


> I'm finding it hard to visualize a non-interactive script making
> any good use of such a setting.  Without a way to test whether
> you got an error or not, it would amount to an "ignore errors
> within transactions" mode, which seems a pretty bad idea.
>
> Can you show a plausible use-case for such a thing?

I could have used this yesterday. I was populating a test table with
a primary key on two columns and needed to add a bunch of random rows.
I generated a 10_000 line file of one insert statement each. Rather than
worrying about collisions, I could simply \rollbackonerror (or whatever
we're calling it today :) and silently discard the handful that happen
to violate the primary key constraint and let the rest insert.

- --
Greg Sabino Mullane greg(at)turnstep(dot)com
PGP Key: 0x14964AC8 200504270754
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8

-----BEGIN PGP SIGNATURE-----

iD8DBQFCb33NvJuQZxSWSsgRAvdfAJwMqysSpVI2BDh9wENT2jxMZnspagCfRlHJ
9ElhNydsz2FsCc1JgI5R+gU=
=h9AW
-----END PGP SIGNATURE-----



In response to

pgsql-hackers by date

Next:From: Robert TreatDate: 2005-04-27 12:32:40
Subject: Re: [HACKERS] Continue transactions after errors in psql
Previous:From: Simon RiggsDate: 2005-04-27 07:45:10
Subject: Re: [HACKERS] Bad n_distinct estimation; hacks suggested?

pgsql-patches by date

Next:From: Robert TreatDate: 2005-04-27 12:32:40
Subject: Re: [HACKERS] Continue transactions after errors in psql
Previous:From: Tom LaneDate: 2005-04-27 03:15:21
Subject: Re: Cleaning up unreferenced table files

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