Re: [HACKERS] Continue transactions after errors in psql - Mailing list pgsql-patches

From Greg Sabino Mullane
Subject Re: [HACKERS] Continue transactions after errors in psql
Date
Msg-id 8a3f483153bb6f01e5d2fe0594abf374@biglumber.com
Whole thread Raw
In response to Re: [HACKERS] Continue transactions after errors in psql  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-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@turnstep.com
PGP Key: 0x14964AC8 200504270754
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8

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

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



pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Cleaning up unreferenced table files
Next
From: Robert Treat
Date:
Subject: Re: [HACKERS] Continue transactions after errors in psql