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 <[EMAIL PROTECTED]> 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
>

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply via email to