Re: [GENERAL] Error that shouldn't happen?

2017-05-19 Thread vinny
On 2017-05-18 21:48, Rob Brucks wrote: Hello Everyone, I am unable to figure out how the trigger was able to successfully create the table, but then fail creating the index. I would have expected one thread to "win" and create both the table and index, but other threads would fail when

Re: [GENERAL] Error that shouldn't happen?

2017-05-18 Thread David G. Johnston
On Thu, May 18, 2017 at 1:46 PM, John R Pierce wrote: > On 5/18/2017 1:40 PM, Andrew Kerber wrote: > >> It appears to me you might be making this a lot more difficult than >> necessary. Why not just pre-create the required partitions daily or weekly >> or monthly? Or do you

Re: [GENERAL] Error that shouldn't happen?

2017-05-18 Thread John R Pierce
On 5/18/2017 1:40 PM, Andrew Kerber wrote: It appears to me you might be making this a lot more difficult than necessary. Why not just pre-create the required partitions daily or weekly or monthly? Or do you have a requirement that a new partition only be created the first time it is required?

Re: [GENERAL] Error that shouldn't happen?

2017-05-18 Thread Pavel Stehule
osed by something like > that. > > > > Thanks, > > Rob > > > > *From: *"David G. Johnston" <david.g.johns...@gmail.com> > *Date: *Thursday, May 18, 2017 at 3:31 PM > *To: *Rob Brucks <rob.bru...@rackspace.com> > *Cc: *"pgsql-general@postgres

Re: [GENERAL] Error that shouldn't happen?

2017-05-18 Thread David G. Johnston
On Thu, May 18, 2017 at 1:39 PM, Rob Brucks wrote: > My point is how did two concurrent threads successfully create the same > table? > ​You seem to not be understanding that "CREATE TABLE IF NOT EXISTS" can succeed without actually creating a table...​ ​David J.​ ​

Re: [GENERAL] Error that shouldn't happen?

2017-05-18 Thread Andrew Kerber
It appears to me you might be making this a lot more difficult than necessary. Why not just pre-create the required partitions daily or weekly or monthly? Or do you have a requirement that a new partition only be created the first time it is required? On Thu, May 18, 2017 at 3:31 PM, David G.

Re: [GENERAL] Error that shouldn't happen?

2017-05-18 Thread Rob Brucks
ace.com> Cc: "pgsql-general@postgresql.org" <pgsql-general@postgresql.org> Subject: Re: [GENERAL] Error that shouldn't happen? On Thu, May 18, 2017 at 1:18 PM, Rob Brucks <rob.bru...@rackspace.com<mailto:rob.bru...@rackspace.com>> wrote: According to this post,

Re: [GENERAL] Error that shouldn't happen?

2017-05-18 Thread David G. Johnston
On Thu, May 18, 2017 at 1:18 PM, Rob Brucks wrote: > According to this post, adding "if not exists" won't really help for race > conditions. > > > > "The bottom line is that CREATE TABLE IF NOT EXISTS doesn't pretend to > > handle concurrency issues any better than

Re: [GENERAL] Error that shouldn't happen?

2017-05-18 Thread Rob Brucks
eate table statement. Thanks, Rob From: "David G. Johnston" <david.g.johns...@gmail.com> Date: Thursday, May 18, 2017 at 3:05 PM To: Rob Brucks <rob.bru...@rackspace.com> Cc: "pgsql-general@postgresql.org" <pgsql-general@postgresql.org> Subject: Re: [GENERAL

Re: [GENERAL] Error that shouldn't happen?

2017-05-18 Thread David G. Johnston
On Thu, May 18, 2017 at 12:48 PM, Rob Brucks wrote: > I am unable to figure out how the trigger was able to successfully create > the table, but then fail creating the index. I would have expected one > thread to "win" and create both the table and index, but other