Re: Generated names (suffix) for constraints not described in docs

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: "Сергей П (SergeiDos)" <podrezov(dot)sergey(at)gmail(dot)com>
Cc: "pgsql-docs(at)lists(dot)postgresql(dot)org" <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Re: Generated names (suffix) for constraints not described in docs
Date: 2024-11-13 14:22:46
Message-ID: CAKFQuwYypoe_44QXqXokL0rq8j-Kbv52fynTG2nFPnb4kjjmJQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Wednesday, November 13, 2024, "Сергей П (SergeiDos)" <
podrezov(dot)sergey(at)gmail(dot)com> wrote:

> <https://translate.google.com/about/?hl=ru>
> <https://policies.google.com/?hl=ru>
> <https://support.google.com/translate/?hl=ru>
> <https://www.google.com/about?hl=ru>
> <https://translate.google.com/about/?hl=ru>
> <https://policies.google.com/?hl=ru>
> <https://support.google.com/translate/?hl=ru>
> <https://www.google.com/about?hl=ru>
> Hello!
> 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. It
could be a randomly generated uuid for all it matters, but we do make some
attempt to make it readable.

Since they are user-facing values I do see some benefit to defining what is
being seen, though precisely how and to what purpose I am unsure. If you
see a name it seems self-describing what it means if you have familiarity
with relational databases. Telling a user what they will get when they
execute SQL without specifying a name is not something I would want to
document.

David J.

<https://translate.google.com/history>
> <https://translate.google.com/saved>
> <https://translate.google.com/history>
> <https://translate.google.com/saved>
>

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2024-11-13 15:00:50 Re: Generated names (suffix) for constraints not described in docs
Previous Message Сергей П (SergeiDos) 2024-11-13 12:06:12 Generated names (suffix) for constraints not described in docs