Re: Select after insert to the unique column

From: "Frank D(dot) Engel, Jr(dot)" <fde101(at)fjrhome(dot)net>
To: Bruno Wolff III <bruno(at)wolff(dot)to>
Cc: Juleni <julo(at)opensubsystems(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: Select after insert to the unique column
Date: 2004-12-13 15:26:24
Message-ID: 59671B88-4D1B-11D9-901F-0050E410655F@fjrhome.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(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.
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
>
-----------------------------------------------------------
Frank D. Engel, Jr. <fde101(at)fjrhome(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Frank D. Engel, Jr. 2004-12-13 15:28:34 Re: Regarding Postgres installation and administration on linux suse 9.0
Previous Message Bruce Momjian 2004-12-13 14:21:43 Re: Temporary tables and disk activity