Harpreet Dhaliwal escribió:
> How can one rollover a sequence back to zero after you delete records from
> a
> table with one such sequence.
> I see it starting with the last value of the sequence inserted.
You can use setval(), but normally you just leave it alone. Having
numbers not starting f
How can one rollover a sequence back to zero after you delete records from a
table with one such sequence.
I see it starting with the last value of the sequence inserted.
On 7/11/07, Tom Allison <[EMAIL PROTECTED]> wrote:
On Jul 10, 2007, at 3:09 PM, Tom Lane wrote:
>
> "Harpreet Dhaliwal" <
On Jul 10, 2007, at 3:09 PM, Tom Lane wrote:
"Harpreet Dhaliwal" <[EMAIL PROTECTED]> writes:
Transaction 1 started, saw max(dig_id) = 30 and inserted new
dig_id=31.
Now the time when Transaction 2 started and read max(dig_id) it
was still 30
and by the time it tried to insert 31, 31 was a
Thanks alot for all your suggestions gentlemen.
I changed it to a SERIAL column and all the pain has been automatically
alleviated :)
Thanks a ton.
~Harpreet
On 7/10/07, Tom Lane <[EMAIL PROTECTED]> wrote:
"Harpreet Dhaliwal" <[EMAIL PROTECTED]> writes:
> Transaction 1 started, saw max(dig_id)
"Harpreet Dhaliwal" <[EMAIL PROTECTED]> writes:
> Transaction 1 started, saw max(dig_id) = 30 and inserted new dig_id=31.
> Now the time when Transaction 2 started and read max(dig_id) it was still 30
> and by the time it tried to insert 31, 31 was already inserted by
> Transaction 1 and hence the
On Jul 10, 2007, at 13:22 , Harpreet Dhaliwal wrote:
Transaction 1 started, saw max(dig_id) = 30 and inserted new
dig_id=31.
Now the time when Transaction 2 started and read max(dig_id) it was
still 30
and by the time it tried to insert 31, 31 was already inserted by
Transaction 1 and hence
I lately figured out the actual problem PHEW.
Its something like two different transactions are seeing the same snapshot
of the database.
Transaction 1 started, saw max(dig_id) = 30 and inserted new dig_id=31.
Now the time when Transaction 2 started and read max(dig_id) it was still 30
and by the
my primary key is neither SERIAL nor a SEQUENCE.
CONSTRAINT pk_dig PRIMARY KEY (dig_id)
This is the clause that I have for my primary key in the create table
script.
thanks,
~Harpreet
On 7/10/07, Ron St-Pierre <[EMAIL PROTECTED]> wrote:
Harpreet Dhaliwal wrote:
> Hi,
>
> I keep getting this
Harpreet Dhaliwal wrote:
Hi,
I keep getting this duplicate unique key constraint error for my
primary key even
though I'm not inserting anything duplicate. It even inserts the
records properly
but my console throws this error that I'm sure of what it is all about.
Corruption of my Primary Ke
Hi,
I keep getting this duplicate unique key constraint error for my primary key
even
though I'm not inserting anything duplicate. It even inserts the records
properly
but my console throws this error that I'm sure of what it is all about.
Corruption of my Primary Key can be one of the possibili
10 matches
Mail list logo