Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPSoR-0001ui-JN for pgsql-docs@arkaria.postgresql.org; Mon, 05 Oct 2020 15:54:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kPSoQ-0005EM-Ft for pgsql-docs@arkaria.postgresql.org; Mon, 05 Oct 2020 15:54:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPSoQ-0005EF-AD for pgsql-docs@lists.postgresql.org; Mon, 05 Oct 2020 15:54:06 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPSoO-00059F-A9 for pgsql-docs@lists.postgresql.org; Mon, 05 Oct 2020 15:54:05 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 095Frw9N1732018; Mon, 5 Oct 2020 11:53:58 -0400 From: Tom Lane To: Pavel Stehule cc: Thomas Kellerer , Pg Docs Subject: Re: Wrong parameter names for make_interval (Postgres 13) In-reply-to: References: <7b154ef0-9f22-90b9-7734-4bf23686695b@gmx.net> Comments: In-reply-to Pavel Stehule message dated "Mon, 05 Oct 2020 16:33:46 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1732016.1601913238.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Mon, 05 Oct 2020 11:53:58 -0400 Message-ID: <1732017.1601913238@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Pavel Stehule writes: > po 5. 10. 2020 v 15:56 odesílatel Thomas Kellerer napsal: >> So instead of >> make_interval ( [ year int [, month int [, week int [, day int [, hour >> int [, min int [, sec double precision ]]]]]]] ) >> it should be >> make_interval ( [ years int [, months int [, weeks int [, days int >> [,hours int [, mins int [, secs double precision ]]]]]]] ) Right, fixed. > this syntax is not correct too > It should be > make_interval( years int default 0, month int default 0, days int > default 0, hours int default 0, secs double precision default 0) IIRC, I intentionally changed that in v13; the existence of the defaults is sufficiently covered by the text "... fields, each of which can default to zero". I think that was partly motivated by trying to get the function signature to fit into limited space. The final docs-table design we ended up with might allow undoing it, but I don't see any real reason to. The other way is more verbose and not any clearer. I spent a little bit of time scanning for other discrepancies between func.sgml and pg_proc.proargnames, and found several, mostly though not exclusively in the JSON functions. In these other cases, though, I think there might be a good argument for making pg_proc fit the docs not the other way around. In the JSON functions, for example, pg_proc randomly has some functions calling the main JSON[B] input "target" while others call it "from_json" or "json_in". I'm not real sure which of those names is preferable, but inconsistency is not preferable. regards, tom lane