From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | "David E(dot) Wheeler" <david(at)justatheory(dot)com> |
Cc: | Erik Wienhold <ewie(at)ewie(dot)name>, jian he <jian(dot)universality(at)gmail(dot)com>, Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>, Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
Subject: | Re: Patch: Add parse_type Function |
Date: | 2024-02-12 17:53:09 |
Message-ID: | 2245610.1707760389@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
"David E. Wheeler" <david(at)justatheory(dot)com> 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
From | Date | Subject | |
---|---|---|---|
Next Message | Matthias van de Meent | 2024-02-12 18:03:30 | Re: Reducing output size of nodeToString |
Previous Message | Tristan Partin | 2024-02-12 17:26:33 | Re: make dist using git archive |