Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uk1m6-00Epnm-ID for pgsql-general@arkaria.postgresql.org; Thu, 07 Aug 2025 14:39:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uk1m5-005Eyn-5Y for pgsql-general@arkaria.postgresql.org; Thu, 07 Aug 2025 14:39:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uk1m4-005EyZ-RB for pgsql-general@lists.postgresql.org; Thu, 07 Aug 2025 14:39:20 +0000 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uk1m2-001EdE-0r for pgsql-general@lists.postgresql.org; Thu, 07 Aug 2025 14:39:19 +0000 Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-3322d1dded6so9491601fa.2 for ; Thu, 07 Aug 2025 07:39:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754577558; x=1755182358; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=0iDZ3CriyDeGFnZdUtwnrIB9b2LxmlT7il/NETmAFBM=; b=QhhftZGe8Tfdu80uaHAA3YtcudyxnOC1jin71n2Pqx81Bj+Aj6HX1y7brDanamqSFk h5ck8l6kTB+xZTOHHuI1NJY6gRxLR2Goe9ORoAl3HCs/H4RnmheNVuNrmnMuwLSsFmfU 8bjBzNnu52NDD+D2nhXBiDy3kpBmAMU5Zq+vzWJE+rhuxor92HZAvTk/pBtkPeempzR8 jLfn3gbnd6+j8kAeljzC951eTepe5iyW68LfbLt2HTwnccXADLLub7za585fKxiuSjRy nSOm9swB2uTjMApYXfLj/jgqX1ZLxj7IKHCG03lOSDadcsBQabQ4JbkXBnHNHUjr2yAD 0QFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754577558; x=1755182358; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0iDZ3CriyDeGFnZdUtwnrIB9b2LxmlT7il/NETmAFBM=; b=jJMs87tud9nrJzd6hrKeyoAWbu2FNsV1xaHm8/maz3fHM5uWAVSC9Cb5T5k5rjNeL1 vvyEtFSkXb6goQhoucjXhgVG5G8g9HRMVGvGYmQomjmY86LauHtEGCTXUTXoO/WmCbDS 3i+SmF+HTprILkYDHuAY2Q1mhhiEW8rIRNadcRDDFBR1m/dIeOBmvdq6kH3mByjmlVr2 1rOExaE/RLC8s+vPxGjdLHPRlZFnUJKCXkQfFo4o74f3iUIUbC+/ODRBZreblLnemldg ZhKmR7UaPuJ4fqFokH7I80clfcH06Ba8j8LpxUAYZblzJylx1/F0up8CkG4clbCzkQ8l jmOA== X-Forwarded-Encrypted: i=1; AJvYcCUcdarKFX2FFmik5Ri5XmHZyufzuMqPdC5qJfwI7coJI9WRDhtkOM4972ZeDSq3Z2kJz1QzIDCiLl5smNxt@lists.postgresql.org X-Gm-Message-State: AOJu0YwJahHaVDUEFkkofGNmW47EryZ9Tyos2pnta6UI7WAQO+cxsv/1 QO9hjcr5pOCOVg9Aq6cb0IaDAOoTX0PnU+F4GsQ4lNotVPj/E5ipkwPOm4n3+T8g0gFVgUHW4xI DtOkE+xiX2ua4/IQOn6/dm0zsM/9oOZM= X-Gm-Gg: ASbGncuBBDznL/gsWie85ZUqdbFjFZY4GUprtIF6cZKlW+ZnVERgd4h8E13l5F0UIfC hDhMGgt0Ct/9kvUI+2xZ8ueQAptnHcakgEmEB1RhBZNTWFCydoaLsRDDbCSor7rQk5E8ZDf05Z6 9wGPNfpFUEGbrgvRQYm6snmn/Zlh2qAA+DGloT3prr4ZbzLiIBQzW5C4sL26eNT5aE4U9xmJcBj QJWeDYAdw== X-Google-Smtp-Source: AGHT+IHPPXEVSH0G1NYcM3iFempb2LhTepOYuB/lv/qWQcnrrAq5oF1eZQlP67458/cfbBzmmzOQ62cREMjPsUS/k5s= X-Received: by 2002:a2e:750:0:b0:333:98c0:72dd with SMTP id 38308e7fff4ca-3339af198a8mr70851fa.1.1754577557198; Thu, 07 Aug 2025 07:39:17 -0700 (PDT) MIME-Version: 1.0 References: <1568931.1754577361@sss.pgh.pa.us> In-Reply-To: <1568931.1754577361@sss.pgh.pa.us> From: Dominique Devienne Date: Thu, 7 Aug 2025 16:39:03 +0200 X-Gm-Features: Ac12FXwQAVsYZkxZ9viqxA0M9OZg24dQWbjAdta8onWKSLSeQSsqk6Ex5fqlzlg Message-ID: Subject: Re: CALL and named parameters To: Tom Lane Cc: "David G. Johnston" , Pavel Stehule , "pgsql-general@lists.postgresql.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Aug 7, 2025 at 4:36=E2=80=AFPM Tom Lane wrote: > Dominique Devienne writes: > > I was expecting an error telling me the procedure exists, but the > > argument name used in the call didn't. Then it's obvious to me what > > mistake I made. If argument names don't participate in the function's > > signature, why should they participate in the lookup? Do the lookup > > based on name and arg types (and count), that gives you a possible > > overload set, which in my second attempt (with a ::name cast) WAS AN > > EXACT MATCH for the signature, then give me an error about the > > argument name, that does NOT tell me the function doesn't exist. > > That's what I would expect. > > Criticism in the form of a patch is welcome ;-). The problem here > is that the matching rules are far more complicated than you seem > to think. It's not clear to me that we can definitively say that > "we would have had a match except the argument name was wrong". > If it is possible to know that, it's quite a few subroutines below > where the error is actually issued (see ParseFuncOrColumn -> > func_get_detail -> FuncnameGetCandidates -> MatchNamedCall). > Maybe there's some fairly painless change that could be made in > that rat's nest, but I lack enough caffeine to see it. How about listing those "candidates" considered? In the detailed message? With arg names. Then it would have been obvious(er), I'm arguing. --DD