Re: [HACKERS] Continue transactions after errors in psql

Поиск
Список
Период
Сортировка
От Greg Sabino Mullane
Тема Re: [HACKERS] Continue transactions after errors in psql
Дата
Msg-id 8a3f483153bb6f01e5d2fe0594abf374@biglumber.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Continue transactions after errors in psql  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Cleaning up unreferenced table files
Следующее
От: Robert Treat
Дата:
Сообщение: Re: [HACKERS] Continue transactions after errors in psql