Re: How to get the value in the lastvalue field

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Venki <Venki(at)insoft(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to get the value in the lastvalue field
Date: 2005-10-26 18:22:14
Message-ID: 20051026182214.GF11447@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Oct 26, 2005 at 18:12:32 +0530,
Venki <Venki(at)insoft(dot)com> wrote:
> Hi
> thanks for the replies. The situation is as follows. We get backups from the
> production server and update the local database in the local server but each
> time when we restore the database backup the sequence values are not getting
> updated properly. So what i thought was to write a function which will check
> the last value of the row in the table and compare it with the lastvalue of
> the sequnce and if it is not proper then update the lastvalue of the
> sequence to a proper value.
>
> I Hope that i have explained the situation properly. If you have any other
> suggestion it will be greatly helpful as we are new to postgres and might be
> doing something wrong when restoring the database.

If you are dumping and restoring by cluster or database, your sequences should
be having their values set upon restore. If you are just restoring indvidual
tables, than you need to adjust your process to also restore the sequence
values.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2005-10-26 18:25:25 Re: Where is the webaddress for the most recent postgresql version?
Previous Message Scott Marlowe 2005-10-26 18:18:50 Re: Why database is corrupted after re-booting