Re: Select after insert to the unique column - Mailing list pgsql-general

From Frank D. Engel, Jr.
Subject Re: Select after insert to the unique column
Date
Msg-id 59671B88-4D1B-11D9-901F-0050E410655F@fjrhome.net
Whole thread Raw
In response to Re: Select after insert to the unique column  (Bruno Wolff III <bruno@wolff.to>)
Responses Re: Select after insert to the unique column
List pgsql-general
If you attempted the inserts within a single transaction and any of
them fail, they will all fail.  The server will automatically undo any
and all changes made by the transaction, and any further steps in the
transaction will simply result in the error message you are getting.
You will not be able to (successfully) issue any further database
commands until you end the transaction and start a new one.

On Dec 11, 2004, at 2:29 PM, Bruno Wolff III wrote:

> On Wed, Dec 08, 2004 at 14:50:04 +0100,
>   Julian Legeny <legeny@softhome.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.
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
>
-----------------------------------------------------------
Frank D. Engel, Jr.  <fde101@fjrhome.net>

$ ln -s /usr/share/kjvbible /usr/manual
$ true | cat /usr/manual | grep "John 3:16"
John 3:16 For God so loved the world, that he gave his only begotten
Son, that whosoever believeth in him should not perish, but have
everlasting life.
$



___________________________________________________________
$0 Web Hosting with up to 120MB web space, 1000 MB Transfer
10 Personalized POP and Web E-mail Accounts, and much more.
Signup at www.doteasy.com


pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Temporary tables and disk activity
Next
From: "Frank D. Engel, Jr."
Date:
Subject: Re: Regarding Postgres installation and administration on linux suse 9.0