Re: Restart a sequence regularly - Mailing list pgsql-general

From Kathy Lo
Subject Re: Restart a sequence regularly
Date
Msg-id c10e7feb0711211739w42140dbesaa82e7da16b759dd@mail.gmail.com
Whole thread Raw
In response to Re: Restart a sequence regularly  ("Scott Marlowe" <scott.marlowe@gmail.com>)
List pgsql-general
On 11/22/07, Scott Marlowe <scott.marlowe@gmail.com> wrote:
> On Nov 21, 2007 11:44 AM, Marco Colombo <marco@esi.it> 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-Dec 23:59:55 and 1-Jan 00:00:05, they are waiting instead of
> > > getting an error.
> >
> > If you remove the privs, clients will get an error, unless I'm missing
> > something.
>
> 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.
>
> hmmmmm.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>
Thanks for your help!

Would you mind to give me an example on how to write this kind of function?

--
Kathy Lo

pgsql-general by date:

Previous
From: "Kathy Lo"
Date:
Subject: Re: Restart a sequence regularly
Next
From: Stephen Frost
Date:
Subject: Re: POLL: Women-sized t-shirts for PostgreSQL