pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Broersma Jr <rabroersma@yahoo.com>
To: Greg Nissen <gnissen@geicp.com>
To: pgsql-odbc@postgresql.org
Subject: Re: auto fill the missing numbers
Date: Tue, 9 Jan 2007 17:54:15 -0800 (PST)
Message-ID: <799740.32678.qm@web31815.mail.mud.yahoo.com> (raw)
In-Reply-To: <BHEJJLIKBGEDLLJPAEFCCEMKDJAA.gnissen@geicp.com>

> ms access already had some 57000 transaction loaded into the old database,
> when i linked to postgres using the ODBC driver, all these transaction came
> over, as excepted, but when i create a new record now, the database is
> filling in all the missing numbers prior to 57000, which jumbles up my
> record table. How can i get the postgres database to start off from 57001

I assume that by transaction you mean record I assume that you are using serial or big serial as
the autonumber for your new postgresql tables.

1) you need to determine the table_sequence name that was created for you table.
2) change the table_sequence value to one greater than the values already stored in the table from
access.

The function you need it setval()
http://www.postgresql.org/docs/8.2/interactive/functions-sequence.html

you can use setval() useing the psql client utility to postgresql.

Regards,
Richard Broersma Jr.



view thread (3+ messages)

Message-ID: <799740.32678.qm@web31815.mail.mud.yahoo.com>
Permalink:  ../799740.32678.qm@web31815.mail.mud.yahoo.com/
Also on:    postgresql.org/message-id/799740.32678.qm@web31815.mail.mud.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: rabroersma@yahoo.com, gnissen@geicp.com
  Subject: Re: auto fill the missing numbers
  In-Reply-To: <799740.32678.qm@web31815.mail.mud.yahoo.com>
  References: <BHEJJLIKBGEDLLJPAEFCCEMKDJAA.gnissen@geicp.com> <799740.32678.qm@web31815.mail.mud.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox