Re: [HACKERS] Continue transactions after errors in psql
Greg Sabino Mullane <greg@turnstep.com>
From: "Greg Sabino Mullane" <greg@turnstep.com>
To: pgsql-hackers@postgresql.org
Cc: pgsql-patches@postgresql.org
Date: 2005-04-27T12:02:21Z
Lists: pgsql-hackers
-----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@turnstep.com PGP Key: 0x14964AC8 200504270754 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -----BEGIN PGP SIGNATURE----- iD8DBQFCb33NvJuQZxSWSsgRAvdfAJwMqysSpVI2BDh9wENT2jxMZnspagCfRlHJ 9ElhNydsz2FsCc1JgI5R+gU= =h9AW -----END PGP SIGNATURE-----