sequence / last_value problem

From: Tina Messmann <tina(dot)messmann(at)xinux(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: sequence / last_value problem
Date: 2002-05-23 11:39:49
Message-ID: 3CECD505.6080400@xinux.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello List,
i did this:
1. dumped out the schema of a table from pgsql7.1.3 (i had to modify it
a bit) and inserted the schema in pgsql7.2.1
The table has a id - field of type serial. (it is the primary key)
The field 'last_value' of the corresponding sequence has the value '1'.
2. dumped out the data of that table from pgsql7.1.3 and inserted the
data in pgsql7.2.1

The field 'last_value' of the corresponding sequence has still the value
'1' (the table contains now ~2 000 000 rows).

Is the reason for this that i didnt't call since now the last_value? Is
this normal and correct behaviour? Do i have to set 'last_value'
manually with setval? Does this mean that when i insert a row not using
the default value of the sequence, i have to update 'last_value' of the
sequence every time manually? Am i missing something?

Regards
Tina

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joel Burton 2002-05-23 12:36:57 Re: How to select rows with values set to NULL
Previous Message Martín Marqués 2002-05-23 11:33:05 problems with pg_dump... with postmaster really