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 1ri67v-00F6yp-S4 for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Mar 2024 05:17:08 +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 1ri67s-000mfr-LH for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Mar 2024 05:17:05 +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 1ri67s-000mfj-9j for pgsql-hackers@lists.postgresql.org; Thu, 07 Mar 2024 05:17:04 +0000 Received: from mail-vs1-xe2d.google.com ([2607:f8b0:4864:20::e2d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1ri67n-003FxG-SB for pgsql-hackers@postgresql.org; Thu, 07 Mar 2024 05:17:03 +0000 Received: by mail-vs1-xe2d.google.com with SMTP id ada2fe7eead31-4725acb539cso209154137.3 for ; Wed, 06 Mar 2024 21:17:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709788620; x=1710393420; darn=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=Bk8kg5DQpjTAuzeUe2TRLOsjT8fbi4ADHHGSzx0WAnQ=; b=DTn/WN1dA1hOXKzP62ol5l/Sl/Seeo10ykAJjLD1P05aQrCdwSBkqNbpOThTd03D+u rgeOSm/AuDuJxjUgfiz6Rpr44P7tJb7JwyYqyAbxRSRJKAv+5t+3PKq9CdPTkRynupuM e14p+rxb9Ek6nB8QJ0OhX1wVfQEkCyXkJDxMi/Qew32GgkBphDvHH4MqWGeYaA2vkfPP 0s8uBOI5PqhtvZqvZeiidvPm2n4C25gS3Uwb5Gm9QYs/CKJeUpiv+qlw1DB+HTaFQloF nIpVweOAwBf5KZNnj19l3nCmlxjrRjk1RE38k0XovkgheOOEqIq1NNeJx9/W8WwsAL0T l0Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709788620; x=1710393420; 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=Bk8kg5DQpjTAuzeUe2TRLOsjT8fbi4ADHHGSzx0WAnQ=; b=KsOegI88xbGfEjeoX+mXgfbT3PCflBuCvBNG3T6Mg2V65Gn8FwvH7Vo5Gz0nDSAOCm xXkvVE5n0K7Y6Fnacey75jnbreHMgrWFzHqNRf8ckjDQ81aQ+dt+C1BoVivkJk492MhX L1YOVKe1CWjWjd/tTe66WyGGp2Ur2gocv0Ax418EsevjSyJJs50QNKE8gvz+p9J3iU9I SMKro40awqRsolYOdTAImmWNsvGG4MABZCzvDqit6zZjBJOMu6T6E5+ztS1BPlENTlqO lW6wDQ1CFxVA6CFsbgQB/v7/iQZfbge1RmuuExGZrEJcfjAoTk4mSn4FxUUW7QOlYKie k3hw== X-Forwarded-Encrypted: i=1; AJvYcCVR23yEc08mH3Vo3QYg1ijvLsMNMXTRjo/B1jb9UOgRDahVsq0Ue98T6i7irp8bDY9if4vmCxxyXq5eU+zb+LpVXL1AKJjxbDb67MNN X-Gm-Message-State: AOJu0Yz1TLL6GZKQO70D3ocEZCSwTKDBeLqw261ZSgKyb3mMUFbV8Jyh KxO5TqXQ7Yn3c12+Mdb8z20cKYcUZP1e24Xfe9fJxA9z+HRvI9t5pBIS/AKHbp9oPFC5/npTOJ+ TQLjV/VQ/qkPvP9Zs0fOLKvxuP7w= X-Google-Smtp-Source: AGHT+IH1LBU6d0t8+XvOBE3GQtdOFpl8zFql7o2Zw8uD/PiewQz2jhyw5EwegBwdbEqs7AlDUgjZRo/coBO/ttQxvRg= X-Received: by 2002:a05:6102:2828:b0:472:b53c:2006 with SMTP id ba8-20020a056102282800b00472b53c2006mr6912489vsb.12.1709788619856; Wed, 06 Mar 2024 21:16:59 -0800 (PST) MIME-Version: 1.0 References: <1cee81f3-312f-30e3-0282-c4df7ee72f93@xs4all.nl> <202403041503.5momp6knupgo@alvherre.pgsql> <1e0e5800-965e-42ed-8caa-362294604243@enterprisedb.com> In-Reply-To: From: jian he Date: Thu, 7 Mar 2024 13:16:49 +0800 Message-ID: Subject: Re: remaining sql/json patches To: Amit Langote Cc: Tomas Vondra , Alvaro Herrera , Erik Rijkers , Andres Freund , Andrew Dunstan , PostgreSQL-development Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk two cosmetic minor issues. +/* + * JsonCoercion + * Information about coercing a SQL/JSON value to the specified + * type at runtime + * + * A node of this type is created if the parser cannot find a cast expression + * using coerce_type() or OMIT QUOTES is specified for JSON_QUERY. If the + * latter, 'expr' may contain the cast expression; if not, the quote-stripped + * scalar string will be coerced by calling the target type's input function. + * See ExecEvalJsonCoercion. + */ +typedef struct JsonCoercion +{ + NodeTag type; + + Oid targettype; + int32 targettypmod; + bool omit_quotes; /* OMIT QUOTES specified for JSON_QUERY? */ + Node *cast_expr; /* coercion cast expression or NULL */ + Oid collation; +} JsonCoercion; comment: 'expr' may contain the cast expression; here "exr" should be "cast_expr"? "a SQL/JSON" should be " an SQL/JSON"?