On Sat, Mar 18, 2023 at 3:55 PM Tom Lane <
tgl@sss.pgh.pa.us> wrote:
>
> Joseph Koshakow <
koshy44@gmail.com> writes:
> > On Sat, Mar 18, 2023 at 3:08 PM Tom Lane <
tgl@sss.pgh.pa.us> wrote:
> >> More specifically, those are from running pg_indent with an obsolete
> >> typedefs list.
>
> > I must be doing something wrong because even after doing that I get the
> > same strange formatting. Specifically from the root directory I ran
>
> Hmm, I dunno what's going on there. When I do this:
>
> > curl
https://buildfarm.postgresql.org/cgi-bin/typedefs.pl -o
> > src/tools/pgindent/typedefs.list
>
> I end up with a plausible set of updates, notably
>
> $ git diff
> diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list
> index 097f42e1b3..667f8e13ed 100644
> --- a/src/tools/pgindent/typedefs.list
> +++ b/src/tools/pgindent/typedefs.list
> ...
> @@ -545,10 +548,12 @@ DataDumperPtr
> DataPageDeleteStack
> DatabaseInfo
> DateADT
> +DateTimeErrorExtra
> Datum
> DatumTupleFields
> DbInfo
> DbInfoArr
> +DbLocaleInfo
> DeClonePtrType
> DeadLockState
> DeallocateStmt
>
> so it sure ought to know DateTimeErrorExtra is a typedef.
> I then tried pgindent'ing datetime.c and timestamp.c,
> and it did not want to change either file. I do get
> diffs like
> DecodeDateTime(char **field, int *ftype, int nf,
> int *dtype, struct pg_tm *tm, fsec_t *fsec, int *tzp,
> - DateTimeErrorExtra *extra)
> + DateTimeErrorExtra * extra)
> {
> int fmask = 0,
>
> if I try to pgindent datetime.c with typedefs.list as it
> stands in HEAD. That's pretty much pgindent's normal
> behavior when it doesn't recognize a name as a typedef.
I must have been doing something wrong because I tried again today and
it worked fine. However, I go get a lot of changes like the following:
- if TIMESTAMP_IS_NOBEGIN(dt2)
- ereport(ERROR,
- (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
- errmsg("timestamp out of range")));
+ if TIMESTAMP_IS_NOBEGIN
+ (dt2)
+ ereport(ERROR,
+ (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
+ errmsg("timestamp out of range")));
Should I keep these pgindent changes or keep it the way I have it?
- Joe Koshakow