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.96) (envelope-from ) id 1vMMiB-007moR-0C for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Nov 2025 08:41:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vMMi9-006KUG-13 for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Nov 2025 08:41:45 +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.96) (envelope-from ) id 1vMMi8-006KU8-3A for pgsql-hackers@lists.postgresql.org; Fri, 21 Nov 2025 08:41:45 +0000 Received: from mail-vk1-xa2a.google.com ([2607:f8b0:4864:20::a2a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vMMi6-000fQo-2d for pgsql-hackers@lists.postgresql.org; Fri, 21 Nov 2025 08:41:44 +0000 Received: by mail-vk1-xa2a.google.com with SMTP id 71dfb90a1353d-55999cc2a87so245389e0c.0 for ; Fri, 21 Nov 2025 00:41:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763714501; x=1764319301; 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=blgATfducMttMSrI0wvK+tTPqjUbU4EYO2XtOOaAUAQ=; b=S2QJutVhFIUb7d7ABrQvaoDoSw+3emlKctgdJL2Iu+zjvW1Ijcc3Rt7sN4lJmIE5Eb sGclsZSELdz7WrEU0uyTIDdtMJpFOmIrimyr5Tp3/hDwC9iTgDzcgjKFSRt0366waTvD NFVCzcLSc2iyH1RZmNEGsdCzT7sAbUMzKjn4GdnrB30tAi+hzgT04iV3bfR+S0mFFsrH tKWsRYI7qpuOoZQADB24YcYTBKeJwrqcWq0x/IX6XnusA2CzLggIweMdivZgkbLEv2Pk /04IXVPtRRf5lZ/7XU65osv5tELSa0sdGsQCJ3Kqvezn3WYMIVvoDEr+ZJQLyOCcD+mN R6LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763714501; x=1764319301; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=blgATfducMttMSrI0wvK+tTPqjUbU4EYO2XtOOaAUAQ=; b=Nl+vHL5qyVABaJceIynYEz9IEy4xDQzCTyW0JYgLNteiW1xlTSZzG8Miq1fBUhtmDq 4uq3oL3v0B4JBrcTip+K1spMpVNX64IoXnjf5ZCFMh8FZNxB6Tpc6wNGU+1wD6RW7dnP Z9Aj/uJ/wFkmCHn8E0r9AkyVMH/xhQ55jhXsVVSoTJLgvL8mBkQpqMvu7cV0ufJtYSeM pyekku/7v+d7w+V7DRy66TmkzrnxS2UK1XtEHyBiPrqgQaL/tsxVShWXjyFMpFKj5p2J Xy2b6Af94idqmyQUQSMaU3nBrJn14wwQ6aO+b7moHo+SOXeEnEF/dJeDcaB6lCcM6env DBAw== X-Forwarded-Encrypted: i=1; AJvYcCUF6oU+ZwhogUad6KRkQYVN9DsKW5juwX2a0HuIPCO4t8DrhnEV0esPV4gmm5M719KC0ftGyX0dOIgCJMjp@lists.postgresql.org X-Gm-Message-State: AOJu0YxvDtbOo+gFjRd/4MxBRCN0Dj99idSL6L1YEZMghC0/RxRfmiv3 zN2XGL8RsLtqI0D39eBGlqOCXVMFwozLcYBr4iO6ZwZOtJZ+0nI+ctf/2NCno/GUoRpY0ZKSSTk V7Zu6vCbq+UoWXh83uVL8+3B9mpaKQL8= X-Gm-Gg: ASbGncsu0tHFDypshXBySFtHbVfTTggOGKrw3DqS9MDtc6mTASksoXJuQo477i3NQIE qWm/bHumD4RQ7sorm4fLjD/W4fxmzvJPEd2N3gdabPXJrxRicU/7gJFNeMfIREm7m3uboM35k2t 8Bw8/aq6TrCpeAT/J2B9vfSrtHF5HRfvAlo58WHcDOyQrLDTWdqqLyoKwUMQr2Hd0flr4FL86Mq GsqbZWOhXyZhTS0x9fsESfLhw3rIlTBQNQ7iiYAhEfMbzW0cvgAe2RL2fmAIRHOH0Z00E2K6fCl Y6k/Uh6+HhcNImuj1A6M+iq5KzMJoo5PZlAgrIgnE/SNrzORZMLs4FAWMVEIycBsAsAF3vnQsGf fnFsPQf6Gi44UCLzsaGbZC/IJjIWSDdj8KzCjYIbvhzYscx4WxBbHybDOsQFAEM3jvDR+wJ8D0a QbfWicmUyE X-Google-Smtp-Source: AGHT+IGJoV6mBBPtCel3MqnO5+Dcn2KNvCzg1oRiAm4khZAoTFQAu16SnhinJM1gZkJSEGaspu+5G3oD9Lh4bLJz6Do= X-Received: by 2002:a05:6122:660a:b0:53c:6d68:1cce with SMTP id 71dfb90a1353d-55b8efff034mr252162e0c.16.1763714501338; Fri, 21 Nov 2025 00:41:41 -0800 (PST) MIME-Version: 1.0 References: <04afcd1f-ed7d-4c0a-add1-50e3719ccbf9@postgresfriends.org> <762ae707-7fdc-43d8-a77a-3a10d12ce21d@postgresfriends.org> In-Reply-To: From: jian he Date: Fri, 21 Nov 2025 16:41:05 +0800 X-Gm-Features: AWmQ_bnlCcbSE5bFnYJiGWnlWxX3B60bZb_skWhRWYpXlcyLIBcT9KfbkA-6L4k Message-ID: Subject: Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions To: Amul Sul Cc: Corey Huinker , Vik Fearing , Isaac Morland , pgsql-hackers@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 Mon, Nov 17, 2025 at 9:43=E2=80=AFPM Amul Sul wrote: > > 10-0004: > > +/* error safe version of textToQualifiedNameList */ > +List * > +textToQualifiedNameListSafe(text *textval, Node *escontext) > > If I am not mistaken, it looks like an exact copy of > textToQualifiedNameList(). I think you can simply keep only > textToQualifiedNameListSafe() and call that from > textToQualifiedNameList() with a NULL value for escontext. This way, > all errsave() or ereturn() calls will behave like ereport(). > > The same logic applies to RangeVarGetRelidExtendedSafe() and > makeRangeVarFromNameListSafe. These can be called from > RangeVarGetRelidExtended() and makeRangeVarFromNameList(), > respectively. > -- > hi. List * textToQualifiedNameList(text *textval) { List *namelist; rawname =3D text_to_cstring(textval); if (!SplitIdentifierString(rawname, '.', &namelist)) ereport(ERROR, (errcode(ERRCODE_INVALID_NAME), errmsg("invalid name syntax"))); } I don=E2=80=99t see any way to pass the escontext (ErrorSaveContext) withou= t changing the textToQualifiedNameList function signature. There are around 30 occurrences of textToQualifiedNameList. changing the function textToQualifiedNameList signature is invasive, so I tend to avoid it. I think it's easier to just duplicate textToQualifiedNameList than changing the function textToQualifiedNameList signature. Am I missing something? -- jian https://www.enterprisedb.com