Re: [GENERAL] all serial type was changed to 1

2017-05-01 Thread Adrian Klaver
On 05/01/2017 05:04 PM, Max Wang wrote: Hi Adrian, Thank you. The strange things is we only use Python do insert/update/delete and do not run other SQL command. The evidence says otherwise, which leads to: So nothing ever pulls data out of the database with SELECTS? There is no monitoring

Re: [GENERAL] all serial type was changed to 1

2017-05-01 Thread Max Wang
@postgresql.org Subject: Re: [GENERAL] all serial type was changed to 1 On 05/01/2017 04:29 PM, Max Wang wrote: > Hi Adrian, > > I checked and found > > is_cycled | f Hmm. A possible cause: test=# insert into serial_test (fld_1) values ('test'); INSERT 0 1 test=# insert into s

Re: [GENERAL] all serial type was changed to 1

2017-05-01 Thread Melvin Davidson
| 29 > > is_cycled | f > > is_called | t > > > > Regards, > > Max > > > > *From:* Melvin Davidson [mailto:melvin6...@gmail.com] > *Sent:* Tuesday, 2 May 2017 9:49 AM > *To:* Adrian Klaver > *Cc:* Max Wang ; Amitabh Kant ; > pgsql-general@postgr

Re: [GENERAL] all serial type was changed to 1

2017-05-01 Thread Adrian Klaver
On 05/01/2017 04:55 PM, Max Wang wrote: Hi Melvin, I already reset id to correct value after this happen. This is a production database. We could not stop and wait for trouble shooting. I manually reset sequence of id to correct value. I would grep for setval in any of the code you have touc

Re: [GENERAL] all serial type was changed to 1

2017-05-01 Thread Max Wang
-general@postgresql.org Subject: Re: [GENERAL] all serial type was changed to 1 On Mon, May 1, 2017 at 7:45 PM, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: On 05/01/2017 04:36 PM, Max Wang wrote: Hi Amitabh, I mean the serial sequence that controls the id value has been set to

Re: [GENERAL] all serial type was changed to 1

2017-05-01 Thread Adrian Klaver
d_1) values ('test3'); ERROR: duplicate key value violates unique constraint "serial_test_pkey" DETAIL: Key (id)=(1) already exists. Regards, Max -Original Message- From: Adrian Klaver [mailto:adrian.kla...@aklaver.com] Sent: Tuesday, 2 May 2017 9:16 AM To: Max Wang ; p

Re: [GENERAL] all serial type was changed to 1

2017-05-01 Thread Melvin Davidson
e | 1 > log_cnt | 0 > is_cycled | f > is_called | f > > > Can you do that on the serial column from one the affected tables and post > the results here? > > > > >> Thanks. >> >> Regards, >> Max >> >> -Original Message-

Re: [GENERAL] all serial type was changed to 1

2017-05-01 Thread Adrian Klaver
ay, 2 May 2017 9:31 AM To: Max Wang ; Amitabh Kant Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] all serial type was changed to 1 On 05/01/2017 04:11 PM, Max Wang wrote: Hi Amitabh, Thank you for suggestion. We did not reach the limit of serial type. Some tables only have hundreds of

Re: [GENERAL] all serial type was changed to 1

2017-05-01 Thread Max Wang
n.kla...@aklaver.com] Sent: Tuesday, 2 May 2017 9:31 AM To: Max Wang ; Amitabh Kant Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] all serial type was changed to 1 On 05/01/2017 04:11 PM, Max Wang wrote: > Hi Amitabh, > > > > Thank you for suggestion. We did not reach the limit of

Re: [GENERAL] all serial type was changed to 1

2017-05-01 Thread Melvin Davidson
On Mon, May 1, 2017 at 7:31 PM, Adrian Klaver wrote: > On 05/01/2017 04:11 PM, Max Wang wrote: > >> Hi Amitabh, >> >> >> >> Thank you for suggestion. We did not reach the limit of serial type. >> Some tables only have hundreds of rows. >> > > It would helpful if you ran the query I showed in my p

Re: [GENERAL] all serial type was changed to 1

2017-05-01 Thread Adrian Klaver
On 05/01/2017 04:11 PM, Max Wang wrote: Hi Amitabh, Thank you for suggestion. We did not reach the limit of serial type. Some tables only have hundreds of rows. It would helpful if you ran the query I showed in my previous post on one the sequences just so we can see. From subsequent post

Re: [GENERAL] all serial type was changed to 1

2017-05-01 Thread Max Wang
Hi Adrian, I checked and found is_cycled | f Regards, Max -Original Message- From: Adrian Klaver [mailto:adrian.kla...@aklaver.com] Sent: Tuesday, 2 May 2017 9:16 AM To: Max Wang ; pgsql-general@postgresql.org Subject: Re: [GENERAL] all serial type was changed to 1 On 05/01/2017

Re: [GENERAL] all serial type was changed to 1

2017-05-01 Thread Rob Sargent
: [GENERAL] all serial type was changed to 1 On Mon, May 1, 2017 at 7:08 PM, Max Wang <mailto:mw...@1080agile.com>> wrote: Hi Adrian, Only sequences (id) reset to 1. Regards, Max -Original Message- From: Adrian Klaver [mailto:adrian.kla...@ak

Re: [GENERAL] all serial type was changed to 1

2017-05-01 Thread Max Wang
Sorry. I mean all tables’ id column were reset to 1. Thanks. From: Melvin Davidson [mailto:melvin6...@gmail.com] Sent: Tuesday, 2 May 2017 9:14 AM To: Max Wang Cc: Adrian Klaver ; pgsql-general@postgresql.org Subject: Re: [GENERAL] all serial type was changed to 1 On Mon, May 1, 2017 at 7

Re: [GENERAL] all serial type was changed to 1

2017-05-01 Thread Adrian Klaver
On 05/01/2017 04:08 PM, Max Wang wrote: Hi Adrian, Only sequences (id) reset to 1. Then per Amitabh Kant's suggestion take a look at the cycle setting for the sequences. For sequence named ts_stamp_test_id_seq: test=# select * from ts_stamp_test_id_seq ; -[ RECORD 1 ]-+

Re: [GENERAL] all serial type was changed to 1

2017-05-01 Thread Melvin Davidson
-general@postgresql.org > Subject: Re: [GENERAL] all serial type was changed to 1 > > On 04/30/2017 10:51 PM, Max Wang wrote: > > Hi All, > > > > > > > > We have a PostgreSQL database. There are 26 tables and we use serial > > type as primary key. We had

Re: [GENERAL] all serial type was changed to 1

2017-05-01 Thread Max Wang
serial type was changed to 1 On Mon, May 1, 2017 at 11:21 AM, Max Wang mailto:mw...@1080agile.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: K

Re: [GENERAL] all serial type was changed to 1

2017-05-01 Thread Max Wang
Hi Adrian, Only sequences (id) reset to 1. Regards, Max -Original Message- From: Adrian Klaver [mailto:adrian.kla...@aklaver.com] Sent: Monday, 1 May 2017 11:30 PM To: Max Wang ; pgsql-general@postgresql.org Subject: Re: [GENERAL] all serial type was changed to 1 On 04/30/2017 10:51

Re: [GENERAL] all serial type was changed to 1

2017-05-01 Thread Max Wang
Subject: Re: [GENERAL] all serial type was changed to 1 On 1 May 2017 at 17:51, Max Wang wrote: > 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: Ke

Re: [GENERAL] all serial type was changed to 1

2017-05-01 Thread Adrian Klaver
On 04/30/2017 10:51 PM, Max Wang 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 tab

Re: [GENERAL] all serial type was changed to 1

2017-05-01 Thread David Rowley
On 1 May 2017 at 17:51, Max Wang wrote: > 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’

Re: [GENERAL] all serial type was changed to 1

2017-05-01 Thread Amitabh Kant
On Mon, May 1, 2017 at 11:21 AM, Max Wang 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 > che

Re: [GENERAL] all serial type was changed to 1

2017-04-30 Thread Peter Geoghegan
On Sun, Apr 30, 2017 at 10:51 PM, Max Wang wrote: > 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 a

[GENERAL] all serial type was changed to 1

2017-04-30 Thread Max Wang
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 datab