Re: [GENERAL] How to get the value in the lastvalue field

2005-10-26 Thread Bruno Wolff III
On Wed, Oct 26, 2005 at 18:12:32 +0530, Venki <[EMAIL PROTECTED]> 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 val

Re: [GENERAL] How to get the value in the lastvalue field

2005-10-26 Thread Sean Davis
On 10/26/05 8:42 AM, "Venki" <[EMAIL PROTECTED]> 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 gett

Re: [GENERAL] How to get the value in the lastvalue field

2005-10-26 Thread Csaba Nagy
might be doing something wrong when restoring the database. > > Regards > venki > > ---Original Message--- > > From: Csaba Nagy > Date: 10/26/05 18:24:48 > To: Venki > Cc: Postgres general mailing list > Subject: Re: [GENERAL] How to get the value in t

Re: [GENERAL] How to get the value in the lastvalue field

2005-10-26 Thread Venki
helpful as we are new to postgres and might be doing something wrong when restoring the database.   Regards venki   ---Original Message---   From: Csaba Nagy Date: 10/26/05 18:24:48 To: Venki Cc: Postgres general mailing list Subject: Re: [GENERAL] How to get the value in the lastvalue

Re: [GENERAL] How to get the value in the lastvalue field

2005-10-26 Thread Sean Davis
On 10/26/05 8:23 AM, "Venki" <[EMAIL PROTECTED]> wrote: > > Hi, > Can anyone in the list tell me how to get the value in the lastvalue field of > a sequence. I tried > select currval('field_seq'); > > but got an error message > > ERROR: currval of sequence "field_seq" is not yet defined in thi

Re: [GENERAL] How to get the value in the lastvalue field

2005-10-26 Thread Csaba Nagy
You can select it from the sequence's associated relation as from any table... try: select * from sequence_name; However, be aware that what you see there is the situation only in your transaction, and it is very possible that other transactions will use higher values concurrently. So it really d

[GENERAL] How to get the value in the lastvalue field

2005-10-26 Thread Venki
 Hi, Can anyone in the list tell me how to get the value in the lastvalue field of a sequence. I tried select currval('field_seq'); but got an error message ERROR:  currval of sequence "field_seq" is not yet defined in this session. I think currval will work only after an insert. I don't wan