public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tom Lane <[email protected]>
To: David E. Wheeler <[email protected]>
Cc: Erik Wienhold <[email protected]>
Cc: jian he <[email protected]>
Cc: Jim Jones <[email protected]>
Cc: Dagfinn Ilmari Mannsåker <[email protected]>
Cc: [email protected]
Cc: Pavel Stehule <[email protected]>
Subject: Re: Patch: Add parse_type Function
Date: Mon, 12 Feb 2024 12:53:09 -0500
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<CACJufxHS2ULcDvZJagS=RVo=Hqq_TC-jOG0euVdKvJ-DkcKtuw@mail.gmail.com>
<[email protected]>
<[email protected]>
"David E. Wheeler" <[email protected]> writes:
> [ v4-0001-Add-parse_type-SQL-function.patch ]
It strikes me that this is basically to_regtype() with the additional
option to return the typmod. That leads to some questions:
* Should we choose a name related to to_regtype? I don't have any
immediate suggestions, but since you didn't seem entirely set on
parse_type, maybe it's worth thinking along those lines. OTOH,
to the extent that people would use this with format_type, maybe
parse_type is fine.
* Perhaps the type OID output argument should be declared regtype
not plain OID? It wouldn't make any difference for passing it to
format_type, but in other use-cases perhaps regtype would be more
readable. It's not a deal-breaker either way of course, since
you can cast oid to regtype or vice versa.
* Maybe the code should be in adt/regproc.c not format_type.c.
* Experience with to_regtype suggests strongly that people would
prefer "return NULL" to failure for an unrecognized type name.
Skimming the patch, I notice that the manual addition to
builtins.h should be unnecessary: the pg_proc.dat entry
should be enough to create an extern in fmgrprotos.h.
Also, I'm pretty sure that reformat_dat_file.pl will
think your pg_proc.dat entry is overly verbose. See
https://www.postgresql.org/docs/devel/system-catalog-initial-data.html
regards, tom lane
view thread (4+ messages) latest in thread
reply
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: Patch: Add parse_type Function
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox