Sequence and nextval problem

Поиск
Список
Период
Сортировка
От Tk421
Тема Sequence and nextval problem
Дата
Msg-id 492AFC8C.302@gmail.com
обсуждение исходный текст
Ответы Re: Sequence and nextval problem  ("Scott Marlowe" <scott.marlowe@gmail.com>)
Re: Sequence and nextval problem  (ries van Twisk <pg@rvt.dds.nl>)
Re: Sequence and nextval problem  (Craig Ringer <craig@postnewspapers.com.au>)
Список pgsql-sql
Hello everybody.
   I've got an vb aplication that uses an Access database. I'm trying 
to convert the database to postgres. The conversion was done ok, but 
i've got a little problem that i don't know how to solve. Let's see if 
anyone can help me.
   The conversion from access database to postgres worked fine. 
Everithing it's ok. But now, when i use my database i've found a problem 
with sequences. In the conversion, the "autonumeric" fields from access 
have been converted to sequences, everithing ok in a first view. The 
problem comes because the autonumeric fields in access always return the 
last value of the table +1, but postgres no. Postgres returns "lost" (i 
don't know how to call them) values. An example.
   This is an example of a table:
      code | description      ----- | ------------          1  | desc 1          2  | desc 2          6  | desc 6
  7  | desc 7
 

   In access if i execute "INSERT INTO table (description) VALUES 
('desc 8'), the result row is  8 |  desc 8   But in postgres the same query te result row is 3 | desc 8
   My question is, can i do something to make ANY sequence to take the 
last value from his associated table, and not a "lost" value?
   Thank you very much



В списке pgsql-sql по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Permission denied for create table
Следующее
От: "Scott Marlowe"
Дата:
Сообщение: Re: Sequence and nextval problem