Re: Scope of constraint names - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Scope of constraint names
Date
Msg-id Pine.LNX.4.44.0207072313440.930-100000@localhost.localdomain
Whole thread Raw
In response to Scope of constraint names  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Scope of constraint names
List pgsql-hackers
Tom Lane writes:

> A considerable advantage of per-relation constraint names is that a new
> unique name can be assigned for a nameless constraint while holding only
> a lock on the target relation.  We'd need a global lock to create unique
> constraint names in the SQL92 semantics.

Presumably, the field pg_class.relchecks already keeps a count of the
number of constraints, so it should be possible to assign numbers easily.

> The only way I can see around that would be to use newoid(), or perhaps
> a dedicated sequence generator, to construct constraint names.  The
> resulting unpredictable constraint names would be horribly messy to deal
> with in the regression tests, so I'm not eager to do this.

Or we simply assign constraint names explicitly in the regression tests.

-- 
Peter Eisentraut   peter_e@gmx.net





pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Proposal: CREATE CONVERSION
Next
From: Bruce Momjian
Date:
Subject: Re: Most system catalog columns should be NOT NULL