Re: Learning Plpgsql ??

From: Rory Campbell-Lange <rory(at)campbell-lange(dot)net>
To: Jonathon Batson <jonathon(at)octahedron(dot)com(dot)au>
Cc: Postgresql Novice List <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Learning Plpgsql ??
Date: 2003-01-23 21:36:17
Message-ID: 20030123213617.GG3718@campbell-lange.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)octahedron(dot)com(dot)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(at)campbell-lange(dot)net>
<www.campbell-lange.net>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Patrick Hatcher 2003-01-23 22:04:24 Long time Vacuum full
Previous Message Tom Lane 2003-01-23 18:06:29 Re: --with-tcl won't gmake