On Wed, Dec 08, 2004 at 14:50:04 +0100,
Julian Legeny <legeny(at)softhome(dot)net> wrote:
> Hello,
>
> Then I want to process command
> select count(*) from UNIQUE_COLUMN_TEST
> that I want to know how many records was already inserted before id
> faied.
>
> But when I try to process that SELECT COUNT(*), there is error
> occured again:
>
> org.postgresql.util.PSQLException:
> ERROR: current transaction is aborted, commands ignored until end of transaction block
>
> How can I solve this?
Depending on what you really want to do, you could do each insert in its
own transaction.
If you don't want any of the inserts to succeed if there are problems, then
you should do the counting in the application doing the inserts.