Re: Learning Plpgsql ?? - Mailing list pgsql-novice

From Rory Campbell-Lange
Subject Re: Learning Plpgsql ??
Date
Msg-id 20030123213617.GG3718@campbell-lange.net
Whole thread Raw
In response to Learning Plpgsql ??  (Jonathon Batson <jonathon@octahedron.com.au>)
List pgsql-novice
Hi Jonathan

I've been using Postgres for a bit but I'm not really an expert.

You have probably seen that the "SERIAL" type expands to
    'not null default nextval('"auto_generated_index_name"'::text)

If you have imported a large set of records with explicit ids you could
simply use the 'setval(index_name,number)' function to reset the sequence's
current value.

Cheers
Rory

On 23/01/03, Jonathon Batson (jonathon@octahedron.com.au) wrote:
> I am porting dbs from Access97 to postgres, tables and data comes across
> fine but the autonumber(sequences) do not
> get updated, so I need to do this manually using > SELECT
> setval(sequence_name,value);
--
Rory Campbell-Lange
<rory@campbell-lange.net>
<www.campbell-lange.net>

pgsql-novice by date:

Previous
From: Prokopis Prokopidis
Date:
Subject: Multiple foreign keys
Next
From: Oliver Elphick
Date:
Subject: Re: Multiple foreign keys