Re: Re: Supplements and suggestions and about postgresql sequence setval function in the documents

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: yanliang lei <msdnchina(at)163(dot)com>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "pgsql-docs(at)lists(dot)postgresql(dot)org" <pgsql-docs(at)lists(dot)postgresql(dot)org>
Subject: Re: Re: Supplements and suggestions and about postgresql sequence setval function in the documents
Date: 2024-08-21 23:59:19
Message-ID: CAApHDvq-HT2ypS+TW+2BTNgWE6+yaKzBm710bASz=pD_rpmkuw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Thu, 22 Aug 2024 at 11:41, yanliang lei <msdnchina(at)163(dot)com> wrote:
> What I want to express is:
> There is no description in the document that the schema name can be included before the sequence name

I'm not to sure there is any problem here. If you look at the final
paragraph in: https://www.postgresql.org/docs/current/functions-sequence.html
you'll see:

"The sequence to be operated on by a sequence function is specified by
a regclass argument, which is simply the OID of the sequence in the
pg_class system catalog. You do not have to look up the OID by hand,
however, since the regclass data type's input converter will do the
work for you. See Section 8.19 for details."

If you navigate to Section 8.19, you'll see:

"All of the OID alias types for objects that are grouped by namespace
accept schema-qualified names, and will display schema-qualified names
on output if the object would not be found in the current search path
without being qualified. For example, myschema.mytable is acceptable
input for regclass (if there is such a table)."

I don't think it would be a good idea to repeat this information each
time we document a function which has a regclass parameter, (or any
other reg* type). Doing so would bloat the documentation quite a lot.
In any case, if we were to do that, why would we limit it to reg*
types? Could someone come along and argue that we didn't reiterate
what an INT type was each time we document a function with an INT
parameter?

I think once the reader learns what a regclass type is, they'll be
quite irritated if we repeatedly tell them what it is again and again.

David

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message PG Doc comments form 2024-08-26 07:15:25 Incorrect option name for meson build
Previous Message David G. Johnston 2024-08-21 23:57:55 Re: Re: Supplements and suggestions and about postgresql sequence setval function in the documents