Skip site navigation (1) Skip section navigation (2)

catching up an id sequence

From: Austin Swinney <austin(at)interactivate(dot)com>
To: pg novice <pgsql-novice(at)postgresql(dot)org>
Subject: catching up an id sequence
Date: 2004-07-29 21:21:59
Message-ID: 53BA885A-E1A5-11D8-B954-000A95B2A15E@interactivate.com (view raw or flat)
Thread:
Lists: pgsql-novice
Hi most esteemed novices and experts.  It is an honor to post here!

I imported a MySQL dump into PostgreSQL (7.4.3) and was wondering what 
a good way to catch up the ID sequence table to be current with the 
table I imported.

In the Perl app associated with the DB, I swapped out currval for 
mysql_insertid.  Then I noticed that the currval reported is started 
from 0,  but there are already 1400+ records in that table that have id 
numbers.

The definition in question is:

  messageid        | integer                     | not null default 
nextval('public.message_messageid_seq'::text)

Ideas?  Many thanks!

Austin


Responses

pgsql-novice by date

Next:From: Tom LaneDate: 2004-07-29 22:01:07
Subject: Re: catching up an id sequence
Previous:From: Betsy BarkerDate: 2004-07-29 18:32:31
Subject: Re: Calling a function that returns a composite type using

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group