Re: Infinite Interval

From: Joseph Koshakow <koshy44(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, "Gregory Stark (as CFM)" <stark(dot)cfm(at)gmail(dot)com>, jian he <jian(dot)universality(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Infinite Interval
Date: 2023-03-19 20:46:58
Message-ID: CAAvxfHdE0eUDButgi7BLTt=Y795n771sJd9uiVF3_-F3T7Pi9g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Mar 18, 2023 at 3:55 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Joseph Koshakow <koshy44(at)gmail(dot)com> writes:
> > On Sat, Mar 18, 2023 at 3:08 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2023-03-19 20:56:14 Re: Commitfest 2023-03 starting tomorrow!
Previous Message stephane tachoires 2023-03-19 20:45:13 Re: Add SPLIT PARTITION/MERGE PARTITIONS commands