Re: [GENERAL] Restart a sequence regularly

2007-11-22 Thread Marco Colombo
Scott Marlowe wrote: > revoke all privs on the sequence to anyone but the user about to reset it > reset it > grant the options back Quoting the OP: > That means, when others want to access the sequence between > 31-Dec 23:59:55 and 1-Jan 00:00:05, they are waiting instead of > getting an error.

Re: [GENERAL] Restart a sequence regularly

2007-11-22 Thread Harald Fuchs
In article <[EMAIL PROTECTED]>, Richard Huxton <[EMAIL PROTECTED]> writes: > Kathy Lo wrote: >> On 11/21/07, Richard Huxton <[EMAIL PROTECTED]> wrote: >>> You probably shouldn't attach any meaning to the numbers from a sequence >>> - they're just guaranteed to be unique, nothing else. > What you

Re: [GENERAL] Restart a sequence regularly

2007-11-21 Thread Richard Huxton
Kathy Lo wrote: On 11/21/07, Richard Huxton <[EMAIL PROTECTED]> wrote: You probably shouldn't attach any meaning to the numbers from a sequence - they're just guaranteed to be unique, nothing else. What you say here contradicts the following. Actually, the sequence is formed by 4-digit of

Re: [GENERAL] Restart a sequence regularly

2007-11-21 Thread Kathy Lo
On 11/22/07, Scott Marlowe <[EMAIL PROTECTED]> wrote: > On Nov 21, 2007 11:44 AM, Marco Colombo <[EMAIL PROTECTED]> wrote: > > Scott Marlowe wrote: > > > revoke all privs on the sequence to anyone but the user about to reset it > > > reset it > > > grant the options back > > > > Quoting the OP: > >

Re: [GENERAL] Restart a sequence regularly

2007-11-21 Thread Kathy Lo
On 11/22/07, Tom Lane <[EMAIL PROTECTED]> wrote: > "Scott Marlowe" <[EMAIL PROTECTED]> writes: > > Good point. I'm guessing if you need a way to make other users wait, > > not get an error, you'll need to use a funtion with a security definer > > that will sleep or something during that period. >

Re: [GENERAL] Restart a sequence regularly

2007-11-21 Thread Kathy Lo
On 11/21/07, Richard Huxton <[EMAIL PROTECTED]> wrote: > Kathy Lo wrote: > > Hi, > > > > I am using Postgresql 8.0.3 in Fedora Core 4. > > > > In my database, it contains a sequence. And, I need to alter the range > > of this sequence and restart it to the start of the new range at > > 00:00:00 on

Re: [GENERAL] Restart a sequence regularly

2007-11-21 Thread Tom Lane
"Scott Marlowe" <[EMAIL PROTECTED]> writes: > Good point. I'm guessing if you need a way to make other users wait, > not get an error, you'll need to use a funtion with a security definer > that will sleep or something during that period. What you'd want is to take out an exclusive lock on the se

Re: [GENERAL] Restart a sequence regularly

2007-11-21 Thread Scott Marlowe
On Nov 21, 2007 11:44 AM, Marco Colombo <[EMAIL PROTECTED]> wrote: > Scott Marlowe wrote: > > revoke all privs on the sequence to anyone but the user about to reset it > > reset it > > grant the options back > > Quoting the OP: > > That means, when others want to access the sequence between > > 31-

Re: [GENERAL] Restart a sequence regularly

2007-11-21 Thread Scott Marlowe
On Nov 21, 2007 1:39 AM, Kathy Lo <[EMAIL PROTECTED]> wrote: > Hi, > > I am using Postgresql 8.0.3 in Fedora Core 4. > > In my database, it contains a sequence. And, I need to alter the range > of this sequence and restart it to the start of the new range at > 00:00:00 on 1st January on every year.

Re: [GENERAL] Restart a sequence regularly

2007-11-21 Thread Richard Huxton
Kathy Lo wrote: Hi, I am using Postgresql 8.0.3 in Fedora Core 4. In my database, it contains a sequence. And, I need to alter the range of this sequence and restart it to the start of the new range at 00:00:00 on 1st January on every year. 5 seconds before and after that time, I need to preven

[GENERAL] Restart a sequence regularly

2007-11-20 Thread Kathy Lo
Hi, I am using Postgresql 8.0.3 in Fedora Core 4. In my database, it contains a sequence. And, I need to alter the range of this sequence and restart it to the start of the new range at 00:00:00 on 1st January on every year. 5 seconds before and after that time, I need to prevent users from calli