[PATCH] PGSERVICEFILE as part of a normal connection string

Ryo Kanbayashi <kanbayashi.dev@gmail.com>

From: Ryo Kanbayashi <kanbayashi.dev@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Torsten Förtsch <tfoertsch123@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2025-03-20T09:16:44Z
Lists: pgsql-hackers

Attachments

On Thu, Mar 20, 2025 at 5:39 PM Ryo Kanbayashi <kanbayashi.dev@gmail.com> wrote:
>
> On Mon, Jan 27, 2025 at 2:01 PM Michael Paquier <michael@paquier.xyz> wrote:
> > On Thu, Mar 13, 2025 at 08:53:49AM +0900, Ryo Kanbayashi wrote:
> > > Putting a bit of context here.  Most of the Postgres hackers based in
> > > Japan had a meeting last Friday, and Kanbayashi-san has asked me about
> > > patches that introduce to simpler code paths in the tree that could be
> > > worked on for this release.  I've mentioned this thread to him.
> > >
> > > > Just to let you know, my action is not intended to steal your
> > > > contribution but to prevent your good idea from being lost.
> > >
> > > Authors and reviewers get busy because of life and work matters, and
> > > contributions are listed in the commit logs for everybody who
> > > participates.  If you can help move this patch forward, thanks a lot
> > > for the help!  IMO, that would be great.  The patch set still needs
> > > more reorganization and adjustments, but I think that we can get it
> > > there
>
> Michael,
> CC: Torsten
>
> I reviewed the patch and add some modification described below.
>
> part of https://www.postgresql.org/message-id/Zz2AE7NKKLIZTtEh%40paquier.xyz
> > +# This tests "service" and "servicefile"
> >
> > You are introducing tests for the existing "service", as well as tests
> > for the new "servicefile".  Could it be possible to split that into
> > two patches for clarity?  You'd want one to provide coverage for the
> > existing features (PGSERVICEFILE, PGSERVICE and connection parameter
> > "service"), then add tests for the new feature "servicename" with its
> > libpq implementation.  That would make your main patch simpler, as
> > well.
> >
> > +open my $fh, '>', $srvfile or die $!;
> > +print $fh "[my_srv]\n";
> > +print $fh +($node->connstr =~ s/ /\n/gr), "\n";
> > +close $fh;
> >
> > Sure that's OK on Windows where we have CRLFs, not just LFs?
>
> I did...
> * Split the patch to two patches
>    1) regression test of existing features.
>    2) adding servicefile option feature, its regression test and etc
> * Add codes which care new line code of Windows
> * Add comments and apply formatter :)

Sorry, I found a miss on 006_service.pl.
Fixed patch is attached...

---
Great Regards,
Ryo Kanbayashi

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. psql: Add variable SERVICEFILE

  2. libpq: Add "servicefile" connection option

  3. libpq: Add TAP test for nested service file

  4. libpq: Fix some issues in TAP tests for service files

  5. docs: Fix column count attribute in table

  6. libpq: Add TAP tests for service files and names