On Mon, May 30, 2022 at 05:27:19PM +0900, Kyotaro Horiguchi wrote:
> At Sat, 28 May 2022 13:22:45 -0700, Andres Freund <andres@anarazel.de> wrote in
> > Hi,
> >
> > On 2022-05-26 16:27:53 +0900, Kyotaro Horiguchi wrote:
> > > It could be in SQL, but *I* prefer to use perl for this, since it
> > > allows me to write a bit complex things (than simple string
> > > comparison) simpler.
> >
> > I wonder if we shouldn't just expose a C function to do this, rather than
> > having a separate implementation in a tap test.
>
> It was annoying that I needed to copy the unit-conversion stuff. I
> did that in the attached. parse_val() and check_val() and the duped
> data is removed.
Note that this gives:
guc.c:7573:9: warning: ‘dst’ may be used uninitialized in this function [-Wmaybe-uninitialized]
with gcc version 9.2.1 20191008 (Ubuntu 9.2.1-9ubuntu2)
I wonder whether you'd consider renaming pg_normalize_config_value() to
pg_pretty_config_value() or similar.
--
Justin