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 1phEwd-0002Uw-MU for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Mar 2023 19:25:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1phEwc-0002ID-8w for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Mar 2023 19:25:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1phEwb-0002I4-TY for pgsql-hackers@lists.postgresql.org; Tue, 28 Mar 2023 19:25:21 +0000 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1phEwZ-000259-KY for pgsql-hackers@lists.postgresql.org; Tue, 28 Mar 2023 19:25:21 +0000 Received: by mail-pj1-x102a.google.com with SMTP id gp15-20020a17090adf0f00b0023d1bbd9f9eso16253912pjb.0 for ; Tue, 28 Mar 2023 12:25:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680031517; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=dqObpzkhXSIcG4wwdJkJIuWEUdGiI0UYaODmZNr2vGM=; b=NqDzmUs80Cz43hMv6NQ+7AmHD8d66a7SaRAweGgEgKI8n2vK1q12v+9KPOusIozf+p 8uM0iAhxSz6RAK1fgCzeP9W3MhxK6LsAOGeErsDwNKs/0F4cuF7Celeqr0lDeR6LWhjT HMMM5fvDM0H0JqM0gFHt0ewn3W/dyih6XbWlIuyQmsDF0Ea1VzBTT1U6S2VHtTvE4+f2 6WZuyfNMlarU3LKWgSU6Gssf2lDnbtekpdBgdzfcuQdKQLLm5OkrMcpw3k8Me5eRp4wy eRcqpKhiv+y/kf0I/VnycsHikS6nVcncDf5wdln+IGVpMwj78h2cK588g2OyLtvl+Nbh BVnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680031517; h=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=dqObpzkhXSIcG4wwdJkJIuWEUdGiI0UYaODmZNr2vGM=; b=1Ho/szKnwNKxZyCKcpwY3lRAmw8FERtHUH/82CPeowN3xDTehYHBB54vHse92f42Ov PpE5iENejBxy3cSAdi9ISfpSQYasozylCQYRQtyCxup405v1nnIGfnL7bhzC8ogTaA12 0lKVsjGz4aqMWkZ9pNjvXCRMtc7AqTC47n/Y1tv7xVyFEHrfEzIAjAU929pGmwhyAalU fOLl2YFca8E4+gwi95yxehxK97hyrMRFqE1u+wXiRRYMJTpk3z/pUn60QdulYP2e9Zc4 bRIQuqdJ24XY/pToAl5Ru2eMa9kPP26OLYYrNMbWrO6RvgqqeYP7otNg99Tx9BQ+Lnxu oBfw== X-Gm-Message-State: AAQBX9cqnkfkgKAaQVfBJM1JShzl5TqNr+9sc6xA3L1cc2UtdmFG3IZN lR8QsvhaEdK2SUoaT3P1yaHc5WzO5klO4XDvmX0= X-Google-Smtp-Source: AKy350Z0wzxqH7MDFBbM9zFeA27xYqxDATyj3nuhqtVRqWu9ki05u5J4SaA3Epj6cQhS/RvIdmdq/F2dYNyBeVEBpEE= X-Received: by 2002:a17:902:868f:b0:1a0:51f6:a252 with SMTP id g15-20020a170902868f00b001a051f6a252mr5788591plo.3.1680031517151; Tue, 28 Mar 2023 12:25:17 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Isaac Morland Date: Tue, 28 Mar 2023 15:25:05 -0400 Message-ID: Subject: Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions To: Corey Huinker Cc: pgsql-hackers@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000ca95b605f7fad1b4" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000ca95b605f7fad1b4 Content-Type: text/plain; charset="UTF-8" On Mon, 19 Dec 2022 at 17:57, Corey Huinker wrote: > > Attached is my work in progress to implement the changes to the CAST() > function as proposed by Vik Fearing. > > CAST(expr AS typename NULL ON ERROR) > will use error-safe functions to do the cast of expr, and will return > NULL if the cast fails. > > CAST(expr AS typename DEFAULT expr2 ON ERROR) > will use error-safe functions to do the cast of expr, and will return > expr2 if the cast fails. > Is there any difference between NULL and DEFAULT NULL? --000000000000ca95b605f7fad1b4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable --000000000000ca95b605f7fad1b4--