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 1w0vjD-002KnQ-13 for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Mar 2026 06:10:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w0vjA-001vF9-2j for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Mar 2026 06:10:29 +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 1w0vjA-001vF1-1Q for pgsql-hackers@lists.postgresql.org; Fri, 13 Mar 2026 06:10:29 +0000 Received: from mail-dy1-x132e.google.com ([2607:f8b0:4864:20::132e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w0vj8-00000001tTX-2jTc for pgsql-hackers@lists.postgresql.org; Fri, 13 Mar 2026 06:10:27 +0000 Received: by mail-dy1-x132e.google.com with SMTP id 5a478bee46e88-2bea5e8032bso673589eec.1 for ; Thu, 12 Mar 2026 23:10:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773382226; cv=none; d=google.com; s=arc-20240605; b=EYdlT3YYiEylhzk2f2Pw1CfBB84mR8cwmNYXL1jOuSu++zG3M+sI8tQUX1T01X1SuK kQq+AqTTnBffudS7OurPUNR9DtFOJl/q1TkIxr8KZvxwnzVKi2WrqEuiR0yyaQzGbx9V f7zTvBlTxzRrmF4O21En4mVgNCTFQq2CUx/zpcULRhd73oFEf4I6Yq92vVbAQelfCc/Z VwdAk1HceHRL6RMsA9j78YOfk4CamUuy4uYICzDkSIonSsd6ZtvNZSQaxQph6lEy358g 2o9SY+kmkgrYxtAJx68j9NtbQ3UZ5wjrIVJFliAoGQjlWnUblq07KVbeB77hpwChGu/z c8HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=ozGvRlIt1xDq4T+0pdE15OyacOyiV3rysi9OnHB671w=; fh=oooCEzDpiEQ+59lh+oNU0Etz6uJrlpyuoOCLSCXsG7M=; b=Lwzqap0RDE1u1LMhl4PwMDB9x/uBUl2BA/cYQbmwdV2wbvHctJ9VkcaCNPrzbqQyi1 tsxON+8FdSIghCYl86uXw7KtoueOYYkugq1xitj1ORJxBz1k+3zhULVvUwVE59a1rdtW eK/JsdzHgTzBphTINytl1PkEWcW2nCfELRf+sph4NCnsI5sSldU7vsvG/ZH7T3ghqx+T Z8fyRHd349MZxbCdeqVW5eWwsxCWn462UAV3POgrOJxcTbTCQDwEYvzZ6vvj4dTCYN+8 IJkO8Nkt4Eod7uAAMyG8KLt37AwMnspgNQ001RQeihzU0da604/VZKZMP8ZU2yw9gjzE grbQ==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773382226; x=1773987026; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ozGvRlIt1xDq4T+0pdE15OyacOyiV3rysi9OnHB671w=; b=W+XbEpm/lk9wSwQwLPas7+qK6e9rfcPJJc+fp2Z4HxIJlcWxsPW2Tj1K28S1Yb+z0h bGRcDhxwQXBnxTZTdZpLjl4vlatbSsXZepVjIKD3FLdYhYOYJd7NxaMlDxFYVWrRs8Mo 2iodq+bcF0HP3Fk73SkGkUXcqaOf2q+OTlQAtCXAAk/vVtu97vvHTB4c6WEirTeoH2N9 9LtlGCV3Yyc2Rnz5XMu9z8Yb4xkuT213WAEnlfzwps9RSxxXKP04oSJKBn2Rb1iK6t9X wZzBe2ooL3JxMfTjDftRKTBj36wDzTMTpaME5bDVUp1YdtvS34lvjpTkTtY6aeoKfIhe ubUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773382226; x=1773987026; h=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=ozGvRlIt1xDq4T+0pdE15OyacOyiV3rysi9OnHB671w=; b=VvrtikGiE6G36WwvYNb2/hH+QFGdX6aVT/E0CVs9ljFLSCx3xEFmrEl6EZwmcAS+gb UJxzZTDFJIThXV7sG2Bv3jzOF7ejOwp0FDpCJCvyaLtMwDRtg5POKP68Bj9CLctToiNT 8UOKeiu8x1xp1tepcP9fnXYvAv2pOW3RMmdM0dJvFUuAmu+H7PXEzAa3Odcnif28w6Ha djb9XhvQFZsJ1aQH1hPU3J28yBiL5ccg0KWjuXf++hcXe9NF/2lWZynaXipNMqFqkPqF YfTA4Hr1KbR9ThIXoiwOK34t5Y9HqVBQ7SeQM4cK79QDUKt8Vqm8xopK46CRvdFIUkFN 2/OQ== X-Forwarded-Encrypted: i=1; AJvYcCUiDPrSZu7je3YmxU4+9TMjLgsgkmJTzRENllUZ4L4bZ7Uy6/JaMDUzibRKjH0CH5W5bFtD5BtGtZXAH5+O@lists.postgresql.org X-Gm-Message-State: AOJu0YwsDjXRWLBd5NPj3/JrgvIIfuAcZmMl3hD3Ca3pV+4bXfgLW4Mm t6od/MK017b8d4Dw8uw8IZ4TuQZVVCa417ct4f1Pvbs+bGsX1EIlXgTTWDI8MO59LEV/s51dhax dccm23tBFaC5LF+njJ9P3tRcfmZRB9ZQ= X-Gm-Gg: ATEYQzzkVDAk7i/BBBwCdM/zDZ75h3hILfC0fuACBim2qaoWdnrF3ftkIOju8UhJ5YH 1FBIuz9kNdxpbkayID2CFeBTHk1SZYgFQbH6K/bLxLQ5RdYDrKUC+ZOQNrVTAXmx9PbKxMuKcGP 9RvushxH+7ePde0fDLkLDn4L9xyFz0kV99H/Vo88NusHvCipfULNvCHn7v4WdThnlIsBxdygNii WCrdo7fguZOjSnOoIEuQrBzQOh+QiyXdE7u0+L/bVOQtMwcplvxunE7izxNPCvmvVP0uwzXOkBo Hok+8hTHHcOYGum3OjQThXp/Z38L5EWKGzqJEA+s6kwNSmjvpYWK7ySZIi5M/qMU9sumwcEKvc5 cjkuCAtmYPnWbwWtzIoZ+A5pr X-Received: by 2002:a05:7022:78f:b0:11b:9386:8271 with SMTP id a92af1059eb24-128f3e235f4mr894794c88.46.1773382225597; Thu, 12 Mar 2026 23:10:25 -0700 (PDT) MIME-Version: 1.0 References: <04afcd1f-ed7d-4c0a-add1-50e3719ccbf9@postgresfriends.org> <762ae707-7fdc-43d8-a77a-3a10d12ce21d@postgresfriends.org> In-Reply-To: From: Corey Huinker Date: Fri, 13 Mar 2026 02:10:13 -0400 X-Gm-Features: AaiRm50wbq2P0kgQ5yQlXtLrsRbcsk3IfzThvRtIiQzSmhmuYRmvr_4-FFgINtU Message-ID: Subject: Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions To: jian he Cc: Amul Sul , Kirill Reshke , Vik Fearing , Isaac Morland , pgsql-hackers@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000009b9911064ce1b9e3" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000009b9911064ce1b9e3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > > > To do that, we need to refactor the RangeVarGetRelidExtended function > to make it error-safe. > We can also change it as: > Ok, thanks. Hmm, seems we've got a new compile error: FAILED: [code=3D1] src/backend/postgres_lib.a.p/executor_execExpr.c.o cc -Isrc/backend/postgres_lib.a.p -Isrc/include -I../src/include -I/usr/include/libxml2 -fdiagnostics-color=3Dalways -D_FILE_OFFSET_BITS=3D6= 4 -Wall -Winvalid-pch -O2 -g -fno-strict-aliasing -fwrapv -fexcess-precision=3Dstandard -D_GNU_SOURCE -Wmissing-prototypes -Wpointer-arith -Werror=3Dvla -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wshadow=3Dcompatible-local -Wformat-security -Wimplicit-fallthrough=3D5 -Wdeclaration-after-statement -Wmissing-variable-declarations -Wno-format-truncation -Wno-stringop-truncation -fPIC -DWITH_GZFILEOP -pthread -DBUILDING_DLL -MD -MQ src/backend/postgres_lib.a.p/executor_execExpr.c.o -MF src/backend/postgres_lib.a.p/executor_execExpr.c.o.d -o src/backend/postgres_lib.a.p/executor_execExpr.c.o -c ../src/backend/executor/execExpr.c ../src/backend/executor/execExpr.c: In function =E2=80=98ExecInitQual=E2=80= =99: ../src/backend/executor/execExpr.c:269:49: error: =E2=80=98escontext=E2=80= =99 undeclared (first use in this function); did you mean =E2=80=98errcontext=E2=80=99? 269 | state->escontext =3D (ErrorSaveContext *) escontext; | ^~~~~~~~~ | errcontext ../src/backend/executor/execExpr.c:269:49: note: each undeclared identifier is reported only once for each function it appears in --0000000000009b9911064ce1b9e3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

To do that, we need to refactor the RangeVarGetRelidExtended function
to make it error-safe.
We can also change it as:

Ok, thanks.= =C2=A0

Hmm, seems we've got a new compile error:
=C2=A0

FAILED: [code=3D1] src/backend/postgr= es_lib.a.p/executor_execExpr.c.o
cc -Isrc/backend/postgres_lib.a.p -Isr= c/include -I../src/include -I/usr/include/libxml2 -fdiagnostics-color=3Dalw= ays -D_FILE_OFFSET_BITS=3D64 -Wall -Winvalid-pch -O2 -g -fno-strict-aliasin= g -fwrapv -fexcess-precision=3Dstandard -D_GNU_SOURCE -Wmissing-prototypes = -Wpointer-arith -Werror=3Dvla -Wendif-labels -Wmissing-format-attribute -Wc= ast-function-type -Wshadow=3Dcompatible-local -Wformat-security -Wimplicit-= fallthrough=3D5 -Wdeclaration-after-statement -Wmissing-variable-declaratio= ns -Wno-format-truncation -Wno-stringop-truncation -fPIC -DWITH_GZFILEOP -p= thread -DBUILDING_DLL -MD -MQ src/backend/postgres_lib.a.p/executor_execExp= r.c.o -MF src/backend/postgres_lib.a.p/executor_execExpr.c.o.d -o src/backe= nd/postgres_lib.a.p/executor_execExpr.c.o -c ../src/backend/executor/execEx= pr.c
../src/backend/executor/execExpr.c: In function =E2=80=98ExecInitQu= al=E2=80=99:
../src/backend/executor/execExpr.c:269:49: error: =E2=80=98= escontext=E2=80=99 undeclared (first use in this function); did you mean = =E2=80=98errcontext=E2=80=99?
=C2=A0 269 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 s= tate->escontext =3D (ErrorSaveContext *) escontext;
=C2=A0 =C2=A0 =C2= =A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 ^~~~~~~~~
=C2=A0 =C2=A0 =C2=A0 | =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 errcontext
../src/backend/executor/execExpr.c:269:49: note: each = undeclared identifier is reported only once for each function it appears in=
=C2=A0
--0000000000009b9911064ce1b9e3--