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 1mlPKJ-0000fb-0N for pgsql-general@arkaria.postgresql.org; Fri, 12 Nov 2021 05:42:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mlPKH-0000Bu-Vz for pgsql-general@arkaria.postgresql.org; Fri, 12 Nov 2021 05:42:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mlPKH-0000Bj-M9 for pgsql-general@lists.postgresql.org; Fri, 12 Nov 2021 05:42:13 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mlPKE-0007SU-JS for pgsql-general@lists.postgresql.org; Fri, 12 Nov 2021 05:42:12 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 1AC5g8AP1648742; Fri, 12 Nov 2021 00:42:09 -0500 From: Tom Lane To: "=?gb18030?B?ucKwwdChtv6hq7Ci4+U=?=" <2903807914@qq.com> cc: "=?gb18030?B?cGdzcWwtZ2VuZXJhbA==?=" Subject: Re: =?gb18030?B?SSBhZGRlZCBhIKHMIG9wZXJhdG9yLCB0aGUgc3Fy?= =?gb18030?B?dCBmdW5jdGlvbiBpcyBzdGlsbCB1c2VkIGludGVy?= =?gb18030?B?bmFsbHksIGJ1dCBub3cgdGhlcmUgaXMgYSBwcm9i?= =?gb18030?B?bGVtLCBpdCBhZmZlY3RzIHRoZSA6PSBhbmQgLi4g?= =?gb18030?B?b3BlcmF0b3JzIG9mIHRoZSBkYXRhYmFzZQ==?= In-reply-to: References: Comments: In-reply-to "=?gb18030?B?ucKwwdChtv6hq7Ci4+U=?=" <2903807914@qq.com> message dated "Fri, 12 Nov 2021 11:41:08 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1648740.1636695728.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 12 Nov 2021 00:42:08 -0500 Message-ID: <1648741.1636695728@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "=3D?gb18030?B?ucKwwdChtv6hq7Ci4+U=3D?=3D" <2903807914@qq.com> writes: > # Description of Requirement: > 1=C2=A1=C2=A2select =C2=A1=C3=8C num1; function > 2=C2=A1=C2=A2The value of num1 is required to be: [0,9223372036854775807= ] > 3=C2=A1=C2=A2=C2=A1=C3=8C The operation does not allow decimals Looks suspiciously like a homework assignment. > I have now developed this feature on the PostgreSQL 14.0 kernel! But it = affects the original function of the database: > # Affected place > 1=C2=A1=C2=A2 :=3D assignment operator > 2=C2=A1=C2=A2 Operator in 1..10 Today's lesson is: read the comments on the code you're modifying. Notably on gram.y's list of "non keyword" tokens: * Non-keyword token types. These are hard-wired into the "flex" lexer. * They must be listed first so that their numeric codes do not depend on * the set of keywords. PL/pgSQL depends on this so that it can share the * same lexer. If you add/change tokens here, fix PL/pgSQL to match! Since you didn't do that, PL/pgSQL is confused about the token codes in use for DOT_DOT and so on. regards, tom lane