On 2015-04-29 15:31:59 -0400, Robert Haas wrote:
> On Wed, Apr 29, 2015 at 3:13 PM, Stephen Frost <sfrost@snowman.net> wrote:
> >> I still think that constraints should never be named in the syntax.
> >
> > I guess I don't see a particular problem with that..? Perhaps I'm
> > missing something, but if there's multiple ways for something to
> > conflict, it might be nice to be able to differentiate between them?
> > Then again, I'm not sure if that's what the intent here is.
>
> So, with unique indexes, people can create an index concurrently, then
> drop the old index concurrently, and nothing breaks. I don't think we
> have a similar capacity for constraints at the moment, but we should.
> When somebody does that dance, the object names change, but all of the
> DML keeps working. That's a property I'd like to preserve.
On the other hand it's way more convenient to specify a single
constraint name than several columns and a predicate. I'm pretty sure
there's situations where I a) rather live with a smaller chance of error
during a replacement of the constraint b) if we get concurrently
replaceable constraints the naming should be doable too.
I don't see your argument strong enough to argue against allowing this
*as an alternative*.
Greetings,
Andres Freund