From: Tom Lane <tgl@sss.pgh.pa.us>
To: 孤傲小二~阿沐 <2903807914@qq.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: I added a √ operator, the sqrt function is still used internally, but now there is a problem, it affects the := and .. operators of the database
Date: Fri, 12 Nov 2021 00:42:08 -0500
Message-ID: <1648741.1636695728@sss.pgh.pa.us> (raw)
In-Reply-To: <tencent_FB9EB101F09A687C499807EF813E946D4E0A@qq.com>
References: <tencent_FB9EB101F09A687C499807EF813E946D4E0A@qq.com>
"=?gb18030?B?ucKwwdChtv6hq7Ci4+U=?=" <2903807914@qq.com> writes:
> # Description of Requirement:
> 1¡¢select ¡Ì num1; function
> 2¡¢The value of num1 is required to be: [0,9223372036854775807]
> 3¡¢¡Ì 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¡¢ := assignment operator
> 2¡¢ 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, 2903807914@qq.com
Subject: Re: I added a √ operator, the sqrt function is still used internally, but now there is a problem, it affects the := and .. operators of the database
In-Reply-To: <1648741.1636695728@sss.pgh.pa.us>
References: <tencent_FB9EB101F09A687C499807EF813E946D4E0A@qq.com> <1648741.1636695728@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox