Re: Getting rid of SQLValueFunction
Ian Lawrence Barwick <barwick@gmail.com>
From: Ian Lawrence Barwick <barwick@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Ted Yu <yuzhihong@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Corey Huinker <corey.huinker@gmail.com>, Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-12-30T01:57:52Z
Lists: pgsql-hackers
Attachments
- v1-0001-Fix-current-local-timestamp-precision-reduction.patch (text/x-patch) patch v1-0001
Hi
2022年11月21日(月) 18:39 Michael Paquier <michael@paquier.xyz>:
>
> On Sun, Nov 20, 2022 at 03:15:34PM -0800, Ted Yu wrote:
> > + * timestamp. These require a specific handling with their typmod is given
> > + * by the function caller through their SQL keyword.
> >
> > typo: typmod is given -> typmod given
> >
> > Other than the above, code looks good to me.
>
> Thanks for double-checking. I intended a different wording, actually,
> so fixed this one. And applied after an extra round of reviews.
I noticed this commit (f193883f) introduces following regressions:
postgres=# SELECT current_timestamp(7);
WARNING: TIMESTAMP(7) WITH TIME ZONE precision reduced to maximum
allowed, 6
ERROR: timestamp(7) precision must be between 0 and 6
postgres=# SELECT localtimestamp(7);
WARNING: TIMESTAMP(7) precision reduced to maximum allowed, 6
ERROR: timestamp(7) precision must be between 0 and 6
Suggested fix attached.
Regards
Ian Barwick
Commits
-
Fix precision handling for some COERCE_SQL_SYNTAX functions
- 7aa81c61ec8f 16.0 landed
-
Replace SQLValueFunction by COERCE_SQL_SYNTAX
- f193883fc9ce 16.0 landed
-
Switch SQLValueFunction on "name" to use COERCE_SQL_SYNTAX
- fb32748e32e2 16.0 landed
-
Improve coverage of ruleutils.c for SQLValueFunctions
- 2e0d80c5bb72 16.0 landed