Re: [GENERAL] possible race condition in trigger functions on insert operations?

2011-11-22 Thread Kenneth Tilton
On Tue, Nov 22, 2011 at 3:52 PM, Merlin Moncure wrote: > On Tue, Nov 22, 2011 at 2:43 PM, David Johnston wrote: >> Just create a single sequence for each year and then call the proper one >> on-the-fly.  You can create multiple sequences in advance and possible even >> auto-create the sequence th

Re: [GENERAL] possible race condition in trigger functions on insert operations?

2011-11-22 Thread Kenneth Tilton
enneth Tilton [mailto:ktil...@mcna.net] > Sent: Tuesday, November 22, 2011 1:52 PM > To: David Johnston > Cc: pgsql-general@postgresql.org > Subject: Re: [GENERAL] possible race condition in trigger functions on > insert operations? > > On Tue, Nov 22, 2011 at 12:48 PM, David Johnst

Re: [GENERAL] possible race condition in trigger functions on insert operations?

2011-11-22 Thread Merlin Moncure
On Tue, Nov 22, 2011 at 2:43 PM, David Johnston wrote: > Just create a single sequence for each year and then call the proper one > on-the-fly.  You can create multiple sequences in advance and possible even > auto-create the sequence the first time one is attempted to be used in a > given year.  

Re: [GENERAL] possible race condition in trigger functions on insert operations?

2011-11-22 Thread David Johnston
-Original Message- From: Kenneth Tilton [mailto:ktil...@mcna.net] Sent: Tuesday, November 22, 2011 1:52 PM To: David Johnston Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] possible race condition in trigger functions on insert operations? On Tue, Nov 22, 2011 at 12:48 PM, David

Re: [GENERAL] possible race condition in trigger functions on insert operations?

2011-11-22 Thread Kenneth Tilton
On Tue, Nov 22, 2011 at 2:05 PM, Andreas Kretschmer wrote: > Kenneth Tilton wrote: > >> On Tue, Nov 22, 2011 at 12:53 PM, Andreas Kretschmer >> wrote: >> > Kenneth Tilton wrote: >> > >> >> Bit of a trigger NOOB Q: >> >> >> >> I am trying to use a trigger function to automatically populate new >

Re: [GENERAL] possible race condition in trigger functions on insert operations?

2011-11-22 Thread Andreas Kretschmer
Kenneth Tilton wrote: > On Tue, Nov 22, 2011 at 12:53 PM, Andreas Kretschmer > wrote: > > Kenneth Tilton wrote: > > > >> Bit of a trigger NOOB Q: > >> > >> I am trying to use a trigger function to automatically populate new > >> rows in a table with  a public ID of the form -NNN such that t

Re: [GENERAL] possible race condition in trigger functions on insert operations?

2011-11-22 Thread Kenneth Tilton
Thanks, that's perfect. -kenneth On Tue, Nov 22, 2011 at 12:53 PM, Merlin Moncure wrote: > On Tue, Nov 22, 2011 at 11:25 AM, Kenneth Tilton wrote: >> Bit of a trigger NOOB Q: >> >> I am trying to use a trigger function to automatically populate new >> rows in a table with  a public ID of the fo

Re: [GENERAL] possible race condition in trigger functions on insert operations?

2011-11-22 Thread Kenneth Tilton
On Tue, Nov 22, 2011 at 12:53 PM, Andreas Kretschmer wrote: > Kenneth Tilton wrote: > >> Bit of a trigger NOOB Q: >> >> I am trying to use a trigger function to automatically populate new >> rows in a table with  a public ID of the form -NNN such that the >> 42nd row created in 2011 would get

Re: [GENERAL] possible race condition in trigger functions on insert operations?

2011-11-22 Thread Kenneth Tilton
l.org > Subject: [GENERAL] possible race condition in trigger functions on insert > operations? > > Bit of a trigger NOOB Q: > > I am trying to use a trigger function to automatically populate new rows in > a table with  a public ID of the form -NNN such that the 42nd row > cre

Re: [GENERAL] possible race condition in trigger functions on insert operations?

2011-11-22 Thread Merlin Moncure
On Tue, Nov 22, 2011 at 11:25 AM, Kenneth Tilton wrote: > Bit of a trigger NOOB Q: > > I am trying to use a trigger function to automatically populate new > rows in a table with  a public ID of the form -NNN such that the > 42nd row created in 2011 would get the ID "2011-042". Each row is > as

Re: [GENERAL] possible race condition in trigger functions on insert operations?

2011-11-22 Thread Andreas Kretschmer
Kenneth Tilton wrote: > Bit of a trigger NOOB Q: > > I am trying to use a trigger function to automatically populate new > rows in a table with a public ID of the form -NNN such that the > 42nd row created in 2011 would get the ID "2011-042". Each row is > associated via an iasid column wit

Re: [GENERAL] possible race condition in trigger functions on insert operations?

2011-11-22 Thread David Johnston
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Kenneth Tilton Sent: Tuesday, November 22, 2011 12:26 PM To: pgsql-general@postgresql.org Subject: [GENERAL] possible race condition in trigger functions on insert

[GENERAL] possible race condition in trigger functions on insert operations?

2011-11-22 Thread Kenneth Tilton
Bit of a trigger NOOB Q: I am trying to use a trigger function to automatically populate new rows in a table with a public ID of the form -NNN such that the 42nd row created in 2011 would get the ID "2011-042". Each row is associated via an iasid column with a row in an audit table that has a