Re: all serial type was changed to 1

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: all serial type was changed to 1
Date: 2017-05-01 23:23:38
Message-ID: e16df2b2-5fd0-68e5-c05b-62427feaa899@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Every row?

On 05/01/2017 05:17 PM, Max Wang wrote:
>
> Sorry. I mean all tables’ id column were reset to 1.
>
> Thanks.
>
> *From:*Melvin Davidson [mailto:melvin6925(at)gmail(dot)com]
> *Sent:* Tuesday, 2 May 2017 9:14 AM
> *To:* Max Wang <mwang(at)1080agile(dot)com>
> *Cc:* Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>;
> pgsql-general(at)postgresql(dot)org
> *Subject:* Re: [GENERAL] all serial type was changed to 1
>
> On Mon, May 1, 2017 at 7:08 PM, Max Wang <mwang(at)1080agile(dot)com
> <mailto:mwang(at)1080agile(dot)com>> wrote:
>
> Hi Adrian,
>
> Only sequences (id) reset to 1.
>
> Regards,
> Max
>
> -----Original Message-----
> From: Adrian Klaver [mailto:adrian(dot)klaver(at)aklaver(dot)com
> <mailto:adrian(dot)klaver(at)aklaver(dot)com>]
> Sent: Monday, 1 May 2017 11:30 PM
> To: Max Wang <mwang(at)1080agile(dot)com <mailto:mwang(at)1080agile(dot)com>>;
> pgsql-general(at)postgresql(dot)org <mailto:pgsql-general(at)postgresql(dot)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 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.
>
> So to be clear:
>
> Every row in each of the 26 tables has an id of 1?
>
> or
>
> Do you mean the sequences where 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
> >
>
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)aklaver(dot)com <mailto:adrian(dot)klaver(at)aklaver(dot)com>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org
> <mailto:pgsql-general(at)postgresql(dot)org>)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>
>
>
> *But as Adrian asked, was the sequence reset to 1 for ALL tables
> sequences or just 1?*
>
> --
>
> *Melvin Davidson*
> *I reserve the right to fantasize. Whether or not you
> wish to share my fantasy is entirely up to you. *
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Igor Korot 2017-05-01 23:28:13 Re: Compatibility of libpg
Previous Message Max Wang 2017-05-01 23:17:54 Re: all serial type was changed to 1