Re: How to get the value in the lastvalue field

From: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
To: Venki <Venki(at)insoft(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to get the value in the lastvalue field
Date: 2005-10-26 12:58:55
Message-ID: BF84F5CF.11CA2%sdavis2@mail.nih.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/26/05 8:42 AM, "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.

I may be wrong, but I thought that sequences were also dumped and restored
with database dumps, unless you are dumping and restoring only data. Is
that the case?

Sean

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Wiersig 2005-10-26 13:19:40 Re: querying PostgreSQL version?
Previous Message Bruce Momjian 2005-10-26 12:58:24 Re: Win32 libpq and ecpg thread safety