Re: Re: inserting, index and no index - speed - Mailing list pgsql-general

From Vivek Khera
Subject Re: Re: inserting, index and no index - speed
Date
Msg-id 15140.15003.509817.672848@yertle.kciLink.com
Whole thread Raw
In response to Re: Re: inserting, index and no index - speed  (Alex Pilosov <alex@pilosoft.com>)
Responses Re: Re: inserting, index and no index - speed  (Alex Pilosov <alex@pilosoft.com>)
List pgsql-general
>>>>> "AP" == Alex Pilosov <alex@pilosoft.com> writes:

TL> Everything is always a transaction in Postgres.  If you don't say
TL> begin/end, then there's an implicit begin and end around each individual
>>
>> This doesn't seem to hold exactly for INSERTs involving sequences as
>> default values.  Even if the insert fails for some other constraint,
>> the sequence is incremented.

AP> No, that's exactly how it is supposed to work, to guarantee that you will
AP> never get same value from two separate calls to nextval.

Even if your transaction fails?  That seems to counter the definition
of a transaction that aborts; the state of the database is different
than before.

Or am I really thinking wrongly about what an aborted transaction
should leave behind?

pgsql-general by date:

Previous
From: Alex Pilosov
Date:
Subject: Re: Re: inserting, index and no index - speed
Next
From: Alex Pilosov
Date:
Subject: Re: Re: inserting, index and no index - speed