Re: CHECKPOINT unlogged data

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: Nathan Bossart <nathandbossart(at)gmail(dot)com>, Christoph Berg <myon(at)debian(dot)org>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: CHECKPOINT unlogged data
Date: 2025-07-10 05:18:45
Message-ID: CAFiTN-tfAqM538W40Z0Y22NTODDi7ThBuUW+o8GD1vHOMLHC+g@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jul 10, 2025 at 10:34 AM Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
>
> On Thu, Jul 10, 2025 at 9:55 AM Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
> >
> > On Thu, Jul 10, 2025 at 9:31 AM Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> wrote:
> > >
> > >
> > >
> > > On 2025/07/10 4:26, Nathan Bossart wrote:
> > > > Here is what I have staged for commit, which I'm planning to do on Friday.
> > >
> > > Thanks for updating the patches!
> > >
> > > Regarding the 0005 patch:
> > >
> > > - COMPLETE_WITH("MODE");
> > > + COMPLETE_WITH("MODE, FLUSH_UNLOGGED");
> > >
> > > Shouldn't that be:
> > >
> > > COMPLETE_WITH("MODE", "FLUSH_UNLOGGED");
> > >
> > > IOW, the two options should be separate strings, so it needs
> > > double quotes around each.
> >
> > I agree that it makes more sense to treat them as 2 separate strings.
>
> I was just playing around with the wrong mode seems error code is not
> correct, see below example
>
> postgres[906701]=# CHECKPOINT ( MODE wrong);
>
> 2025-07-10 05:00:41.644 UTC [906701] ERROR: unrecognized MODE option
> "mode" at character 14
>
> 2025-07-10 05:00:41.644 UTC [906701] STATEMENT: CHECKPOINT ( MODE wrong);
>
> ERROR: 42601: unrecognized MODE option "mode"
>
> LINE 1: CHECKPOINT ( MODE wrong);
>
> IMHO the error should be "unrecognized MODE option "wrong" not the "mode" ?
>
> While looking at the code it seems problem is here instead if
> 'opt->defname' we should use 'mode' variable.
>
> + else if (strcmp(mode, "fast") != 0)
> + ereport(ERROR,
> + (errcode(ERRCODE_SYNTAX_ERROR),
> + errmsg("unrecognized MODE option \"%s\"", opt->defname),
> + parser_errposition(pstate, opt->location)));

Attached fixup patch, fixes this issue as well as there is wrong
suggestion in tab completion, currently it suggest "CHECKPOINT (MODE,
FLUSH_UNLOGGED )" which is wrong, so this would be fixed what Fuji
suggested upthread to make them a 2 separate stings.

--
Regards,
Dilip Kumar
Google

Attachment Content-Type Size
fixup.patch application/octet-stream 1.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2025-07-10 05:21:38 Re: [PATCH] PGSERVICEFILE as part of a normal connection string
Previous Message Yugo Nagata 2025-07-10 05:11:29 Re: Extend ALTER DEFAULT PRIVILEGES for large objects