public inbox for [email protected]  
help / color / mirror / Atom feed
From: Maiquel Grassi <[email protected]>
To: Pavel Luzanov <[email protected]>
To: Nathan Bossart <[email protected]>
Cc: Erik Wienhold <[email protected]>
Cc: [email protected] <[email protected]>
Subject: RE: Psql meta-command conninfo+
Date: Thu, 8 Feb 2024 14:58:19 +0000
Message-ID: <CP8P284MB249652F5F0BE828C20A38348EC442@CP8P284MB2496.BRAP284.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <[email protected]>
References: <CP8P284MB24965CB63DAC00FC0EA4A475EC462@CP8P284MB2496.BRAP284.PROD.OUTLOOK.COM>
	<20240206181919.GA3853632@nathanxps13>
	<aevq2dxmw2xm2rc3nh2wdcozunipco447mf4rpm7efvqvz4wk2@mo3zmf2ulbzu>
	<CP8P284MB2496B51FC5ED9BD6527D459DEC462@CP8P284MB2496.BRAP284.PROD.OUTLOOK.COM>
	<20240206210605.GA3903769@nathanxps13>
	<20240206211205.GA3903996@nathanxps13>
	<CP8P284MB24965479BA59DF5C2CC01CA0EC462@CP8P284MB2496.BRAP284.PROD.OUTLOOK.COM>
	<20240206215022.GA3452@nathanxps13>
	<CP8P284MB2496A17A9852265A0F363A6AEC452@CP8P284MB2496.BRAP284.PROD.OUTLOOK.COM>
	<[email protected]>
	<CP8P284MB24961361A9C1D32C28A7EC0EEC452@CP8P284MB2496.BRAP284.PROD.OUTLOOK.COM>
	<[email protected]>
	<CP4P284MB24830F5BF17FFA7F3D733142EC452@CP4P284MB2483.BRAP284.PROD.OUTLOOK.COM>
	<[email protected]>

> Hi,

> On 07.02.2024 23:13, Maiquel Grassi wrote:


> Regarding the "system_user" function, as it is relatively new, I added
> the necessary handling to avoid conflicts with versions lower than version 16.


> Yes, that's rights.
>
> A couple of doubts about the implementation details.
> But keep in mind that I'm not very good at programming in the C language.
> I hope for the help of more experienced developers.
>
>
> 1.
> +                     if (db == NULL)
> +                             printf(_("You are currently not connected to a database.\n"));
>
> This check is performed for \conninfo, but not for \conninfo+.
>
>
> 2.
> Some values (address, socket) are evaluated separately for \conninfo
> (via C functions) and for \conninfo+ (via sql functions).
> It may be worth evaluating them in one place. But I'm not sure about that.
>
> The final version of the patch will require changes to the documentation and tests.

--//--

Hi Pavel,

First of all, thank you very much for your observations.

1. The connection check for the case of \conninfo+ is handled by "describe.c" itself since it deals with queries. I might be mistaken, but I believe that by using "printQuery()" via "describe.c", this is already ensured, and there is no need to evaluate the connection status.

2. I believe that by implementing the evaluations separately as they are, it becomes easier to perform future maintenance by minimizing the mixing of C code with SQL code as much as possible. However, certainly, the possibility of a better suggestion than mine remains open.

Regards,
Maiquel O. Grassi.


view thread (42+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: RE: Psql meta-command conninfo+
  In-Reply-To: <CP8P284MB249652F5F0BE828C20A38348EC442@CP8P284MB2496.BRAP284.PROD.OUTLOOK.COM>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox