Re: all serial type was changed to 1

From: Max Wang <mwang(at)1080agile(dot)com>
To: Amitabh Kant <amitabhkant(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: all serial type was changed to 1
Date: 2017-05-01 23:11:51
Message-ID: ME1PR01MB13946DF349CB375723D8B719A8140@ME1PR01MB1394.ausprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Amitabh,

Thank you for suggestion. We did not reach the limit of serial type. Some tables only have hundreds of rows.

Regards,
Max

From: Amitabh Kant [mailto:amitabhkant(at)gmail(dot)com]
Sent: Monday, 1 May 2017 7:58 PM
To: Max Wang <mwang(at)1080agile(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] all serial type was changed to 1

On Mon, May 1, 2017 at 11:21 AM, Max Wang <mwang(at)1080agile(dot)com<mailto:mwang(at)1080agile(dot)com>> wrote:
Hi All,

We have a PostgreSQL database. There are 26 tables and we use serial type as primary key. We had a insert error as “duplicate key value violates unique constraint, DETAIL: Key (id)=(1) already exists.” one weeks ago. I checked and found all tables’ id were reset to 1.

I checked database log and did not find any useful information. I am not sure why this happen. The only script which connect to this database is a Python script and only do normal insert/update/delete actions.

Please give me some suggestions if you happen to know something about this issue. I appreciate any feedback you might have.

I am very new to PostgreSQL and this mail list. Please let me know if I did not something wrong.

Thank you.

Regards,
Max

By any chance, has it to do anything with the Cycle option of sequences:

https://www.postgresql.org/docs/9.5/static/sql-createsequence.html

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Melvin Davidson 2017-05-01 23:13:56 Re: all serial type was changed to 1
Previous Message Max Wang 2017-05-01 23:08:30 Re: all serial type was changed to 1