On Wed, 2009-12-02 at 10:36 +0100, Thomas Bellman wrote: > Ohad Levy wrote: > > > On Wed, Dec 2, 2009 at 5:09 PM, Thomas Bellman <[email protected] > > <mailto:[email protected]>> wrote: > [...] > > > > That sounds like something that should be enforced by the database > > schema, not by the application. > > > > as far as I'm aware, there is no way to do it in the db / schema for all > > of our supported databases, therefore you still need to do it in the > > application level - I would be happy to be proven wrong. > > I thought CREATE UNIQUE INDEX was standard SQL since at least two decades.
It is. > I believe MySQL with the MyISAM backend doesn't actually enforce uniqueness, > but MyISAM is so utterly broken that we ought not to support that at all. > Are there any other "databases" that doesn't enforce constraints? That's wrong, MyISAM supports uniqueness constraints. What MyISAM doesn't support is transactions and foreign keys. I would not advice running MyISAM in production. > (Note though that I don't know how the database schema we use look like, > so I don't know how painful it would be to add such indexes to the > current schema.) It is not painful: it is impossible for the reason I already gave in the other branch of this thread. Basically fact names, tag names, or parameter names can't be unique in a transaction system, because transaction are run in isolation. Adding uniqueness constraint to those tables will only create failing transactions if two transactions try to add the same fact names. -- Brice Figureau Follow the latest Puppet Community evolutions on www.planetpuppet.org! -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
