Re: Generated names (suffix) for constraints not described in docs
От | Tom Lane |
---|---|
Тема | Re: Generated names (suffix) for constraints not described in docs |
Дата | |
Msg-id | 1363392.1731510050@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Generated names (suffix) for constraints not described in docs ("David G. Johnston" <david.g.johnston@gmail.com>) |
Список | pgsql-docs |
"David G. Johnston" <david.g.johnston@gmail.com> writes: > On Wednesday, November 13, 2024, "Сергей П (SergeiDos)" < > podrezov.sergey@gmail.com> wrote: >> In the documentation for the Constraints section >> https://www.postgresql.org/docs/current/ddl-constraints.html there is a >> phrase: "So, to specify a named constraint, use the key word CONSTRAINT >> followed by an identifier followed by the constraint definition. (If you >> can't specify a constraint name in this way, the system choose a name for >> you.)" >> But nowhere in the documentation are the rules by which it generates names >> on its own described. > Correct. Which means the specific name chosen is an implementation detail > that can change at any time and should not be relied upon by the > DBA. Indeed. I double-checked the SQL spec and found that it says 3) If <constraint name definition> is not specified, then a <constraint name definition> that contains an implementation- dependent <constraint name> is implicit. The assigned <constraint name> shall obey the Syntax Rules of an explicit <constraint name>. "Implementation-dependent" is standards-ese for "implementations don't have to document their exact behavior". (If it said "implementation-defined", that would mean we should.) So not documenting it is expected. I think we have indeed changed the details around this in the past. regards, tom lane
В списке pgsql-docs по дате отправления: