Re: Changing ids conflicting with serial values? - Mailing list pgsql-general

From Alex Turner
Subject Re: Changing ids conflicting with serial values?
Date
Msg-id 33c6269f0511040849o35afebd8ja63b76946bd4e266@mail.gmail.com
Whole thread Raw
In response to Re: Changing ids conflicting with serial values?  (Marc Boucher <achernar@gmx.net>)
Responses Re: Changing ids conflicting with serial values?
List pgsql-general
I think he meant

create sequence test_seq;
select setval('test_seq',(select max(primary_key_id) from my_table));

not max value of a serial type.

Alex

On 11/3/05, Marc Boucher <achernar@gmx.net> wrote:
> On Wed, 02 Nov 2005 19:29:10 -0800, you wrote:
>
> >It's a migration thing - MySQL prevented this
> >situation due to the way it handles auto_increment (it will never assign
> >you an id that already exists).
>
> AFAIK, in mysql, if you modify a serial by setting it to the max value for
> this type, mysql will fail all new inserts.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not
>        match
>

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Bug in Role support?
Next
From: Robert Fitzpatrick
Date:
Subject: Division