RE: Psql meta-command conninfo+

2024-06-05 Thread Maiquel Grassi
art the development of the view. Even you, if you have the interest and time to do it. At this exact moment, I am involved in a "my baby born" project, so I am unable to stop to look into this. If someone wants to start, I would appreciate it. Regards, Maiquel Grassi.

RE: Psql meta-command conninfo+

2024-05-29 Thread Maiquel Grassi
Hi, Is there someone willing to help me with this development and guide the patch so that it can be committed one day? Regards, Maiquel.

Re: First draft of PG 17 release notes

2024-05-10 Thread Maiquel Grassi
Mhd Enviado desde Outlook para Android From: Bruce Momjian Sent: Friday, May 10, 2024 4:47:04 PM To: Daniel Verite Cc: PostgreSQL-development Subject: Re: First draft of PG 17 release notes On Fri, May 10, 2024 at 06:29:11PM +0200,

RE: Psql meta-command conninfo+

2024-04-04 Thread Maiquel Grassi
Hi! (v29) I left the command \conninfo in its original form. I removed the 'Application Name' column from the \conninfo+ command. Thanks, Maiquel Grassi. v29-0001-psql-meta-command-conninfo-plus.patch Description: v29-0001-psql-meta-command-conninfo-plus.patch

RE: Psql meta-command conninfo+

2024-04-04 Thread Maiquel Grassi
you think we can proceed with the patch this way? I am open to ideas that make \conninfo not limited to just four or five basic pieces of information and easily bring everything else to the screen. Regards, Maiquel Grassi.

RE: Psql meta-command conninfo+

2024-04-04 Thread Maiquel Grassi
ove towards v29. I'm not in a hurry, I just want it to be implemented in the best possible shape. Best regards, Maiquel Grassi.

RE: Psql meta-command conninfo+

2024-04-04 Thread Maiquel Grassi
| SSL Cipher | SSL Compression | GSSAPI Authenticated | f GSSAPI Principal | GSSAPI Encrypted | f GSSAPI Credentials Delegated | f Regards, Maiquel Grassi. v28-0001-psql-meta-command-conninfo-plus.patch Description: v28-0001-psql-meta-command-conninfo-plus.patch

RE: Psql meta-command conninfo+

2024-04-04 Thread Maiquel Grassi
context; see the current_user() function in for more details. ---//--- Hi Sami! (v27) I made the adjustment in the documentation. Thank you for the time dedicated to this feature. Regards, Maiquel Grassi. v27-0001-psql-meta-command-conninfo

RE: Psql meta-command conninfo+

2024-04-03 Thread Maiquel Grassi
t; for more details. I updated the patch. Thank you for this help. Regards, Maiquel Grassi. v26-0001-psql-meta-command-conninfo-plus.patch Description: v26-0001-psql-meta-command-conninfo-plus.patch

RE: Psql meta-command conninfo+

2024-04-01 Thread Maiquel Grassi
function is not > great. Here I considered your suggestion (Sami and Álvaro's). However, I haven't yet added the links for the functions system_user(), current_user(), and session_user(). I'm not sure how to do it. Any suggestion on how to create/add the link? Regards, Maiquel Grassi. v25-0001-psql-meta-command-conninfo-plus.patch Description: v25-0001-psql-meta-command-conninfo-plus.patch

RE: Psql meta-command conninfo+

2024-04-01 Thread Maiquel Grassi
. -//- Hi Sami, I considered your suggestions and Álvaro's suggestions Regards, Maiquel Grassi.

RE: Psql meta-command conninfo+

2024-04-01 Thread Maiquel Grassi
Hi! (v24) > I meant those columns to be just examples, but this should be applied to > all the other columns in the output as well. Applied the translation to all columns. Regards, Maiquel Grassi. v24-0001-psql-meta-command-conninfo-plus.patch Description: v24-0001-psql-meta-command-co

RE: Psql meta-command conninfo+

2024-03-31 Thread Maiquel Grassi
PID | 1693 System User | Current User | postgres Session User | postgres Application Name | psql SSL Connection | f SSL Protocol | SSL Cipher | SSL Compression | GSSAPI Authenticated | f GSSAPI Principal | GSSAPI Encrypted | f GSSAPI Credentials Delegated | f Regards, Maiquel Grassi. v23-0001-psql-meta-command-conninfo-plus.patch Description: v23-0001-psql-meta-command-conninfo-plus.patch

RE: Psql meta-command conninfo+

2024-03-30 Thread Maiquel Grassi
n Name | psql SSL Connection | f SSL Protocol | SSL Cipher | SSL Compression | GSSAPI Authenticated | f GSSAPI Principal | GSSAPI Encrypted | f GSSAPI Credentials Delegated | Regards, Maiquel Grassi. v22-0001-psql-meta-command-conninfo-plus.patch Description: v22-0001-psql-meta-command-conninfo-plus.patch

RE: Psql meta-command conninfo+

2024-03-28 Thread Maiquel Grassi
| f SSL Protocol | SSL Cipher | SSL Compression | GSSAPI Authenticated | f GSSAPI Principal | GSSAPI Encrypted | f GSSAPI Credentials Delegated | f Regards, Maiquel Grassi. v21-0001-psql-meta-command-conninfo-plus.patch Description: v21-0001-psql-meta-command-conninfo-plus.patch

RE: Psql meta-command conninfo+

2024-03-27 Thread Maiquel Grassi
tgreSQL versioning > regarding the views used. --//-- Olá Nathan! I think we are very close to possibly finishing this patch, and I would like your help to do it. Is there any correction you deem necessary still? Regards, Maiquel Grassi.

RE: Psql meta-command conninfo+

2024-03-18 Thread Maiquel Grassi
On Thu, Feb 29, 2024 at 10:02:21PM +, Maiquel Grassi wrote: > Sorry for the delay. I will make the adjustments as requested soon. Looking forward to it. // Hi Nathan! Sorry for the delay, I was busy with other professional as well as personal activities. I made all the chan

RE: Psql meta-command conninfo+

2024-02-29 Thread Maiquel Grassi
On Sat, Feb 17, 2024 at 02:53:43PM +, Maiquel Grassi wrote: >> The "pg_stat_ssl" view is available from >= PG 9.5, and the "pg_stat_gssapi" >> view is >> available from >= PG 12. The "compression" column was removed from the >> "

RE: Psql meta-command conninfo+

2024-02-21 Thread Maiquel Grassi
Hi! (v19) Adjusted the description of each column in the documentation as promised. I used the existing documentation as a basis for each SQL function used, as well as for functions and views related to SSL and GSSAPI (documentation). If you can validate, I appreciate it. Regards, Maiquel

RE: Psql meta-command conninfo+

2024-02-17 Thread Maiquel Grassi
s | 127.0.0.1 Server Port| 5433 Client Address | 127.0.0.1 Client Port| 36016 Socket Directory | Host | 127.0.0.1 SSL Connection | t SSL Protocol | TLSv1.2 SSL Cipher | ECDHE-RSA-AES256-GCM-SHA384 SSL Compression| off GSSAPI | f Thank you very much for your sugestions and help! Maiquel Grassi. v18-0001-psql-meta-command-conninfo-plus.patch Description: v18-0001-psql-meta-command-conninfo-plus.patch

RE: Psql meta-command conninfo+

2024-02-16 Thread Maiquel Grassi
the existing previous ideas from the documentation, I've created a provisional prototype of the column descriptions. At a later stage, I'll place the descriptions correctly by removing placeholders (blah blah blah). Along with this, I'll evaluate an iteration suggested by Nathan Bossart, who also proposed changes. Thank you for your work. Regards, Maiquel Grassi. v17-0001-psql-meta-command-conninfo-plus.patch Description: v17-0001-psql-meta-command-conninfo-plus.patch

RE: Psql meta-command conninfo+

2024-02-15 Thread Maiquel Grassi
Hi! (v16) In this version, I made a small adjustment to the indentation of the \conninfo code and described the columns as returned by \conninfo+ as suggested by Jim Jones. Regards, Maiquel Grassi. v16-0001-psql-meta-command-conninfo-plus.patch Description: v16-0001-psql-meta-command-conninfo

RE: Psql meta-command conninfo+

2024-02-15 Thread Maiquel Grassi
a table. >Perhaps briefly mentioning the returned columns or simply listing them >would be IMHO a nice addition. For some users the semantics of >"Authenticated User", "System User", "Current User" and "Session User" >can be a little confusing. And yes, I realize the current documentation >of \conninfo is already a little vague :). Your suggestion was well received, and I'will made the adjustment to make the command description more comprehensive. Here is version v15 where I sought to correct 'Adress' to make it the same as 'Server Address'. Could you perform the same test and validate? Thank you so much! Maiquel Grassi. v15-0001-psql-meta-command-conninfo-plus.patch Description: v15-0001-psql-meta-command-conninfo-plus.patch

RE: Psql meta-command conninfo+

2024-02-12 Thread Maiquel Grassi
Port| Socket Directory | /tmp Host | postgres=# \conninfo FATAL: terminating connection due to administrator command server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. The connection to the server was lost. Attempting reset: Succeeded. In both cases, the sessions were terminated by another session. Regards, Maiquel Grassi. v14-0001-psql-meta-command-conninfo-plus.patch Description: v14-0001-psql-meta-command-conninfo-plus.patch

RE: Psql meta-command conninfo+

2024-02-10 Thread Maiquel Grassi
stgres Backend PID| 15811 Server Address | ::1 Server Port| 5433 Client Address | ::1 Client Port| 40622 Socket Directory | Host | localhost Encryption | SSL Protocol | TLSv1.2 Cipher | ECDHE-RSA-AES256-GCM-SHA384 Compression| off Regards, Maiquel Grassi. v13-0001-psql-meta-command-conninfo-plus.patch Description: v13-0001-psql-meta-command-conninfo-plus.patch

RE: Psql meta-command conninfo+

2024-02-09 Thread Maiquel Grassi
sed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. The connection to the server was lost. Attempting reset: Succeeded. postgres=# Tks a lot! Maiquel Grassi.

RE: Psql meta-command conninfo+

2024-02-09 Thread Maiquel Grassi
interested in creating a setof information directly related to the connection. I prefer to keep it suppressed for now. In the future, if necessary, we can add this information without any problem. In v12, "Server Version" is already removed. Tks! Maiquel Grassi.

RE: Psql meta-command conninfo+

2024-02-09 Thread Maiquel Grassi
terms already in use in PostgreSQL. This ensures that the user doesn't get confused. I've changed it to "Backend PID". >On 08.02.2024 17:58, Maiquel Grassi wrote: > 1. > + if (db == NULL) > + printf(_("You are currently not

RE: Psql meta-command conninfo+

2024-02-09 Thread Maiquel Grassi
elieve something like "ssl_gss_info.h" and "ssl_gss_info.c". I'm not sure, but at first glance, this is what occurs to me. Do you have any better or more concise suggestions for resolving this? Regards, Maiquel Grassi. v11-0001-psql-meta-command-conninfo-plus.patch Description: v11-0001-psql-meta-command-conninfo-plus.patch v11-0001-psql-meta-command-conninfo-plus.patch Description: v11-0001-psql-meta-command-conninfo-plus.patch

RE: Psql meta-command conninfo+

2024-02-08 Thread Maiquel Grassi
that are handled by TailMatchesCS(...). For example: \ENCODING autocompletes to \encoding \eNcOdInG autocompletes to \encoding \dU or \DU autocompletes to \du Including the command under discussion: \CONNINFO autocompletes to \conninfo For the meta-commands[+], there is no autocomplete. Regards, Maiquel Grassi.

RE: Psql meta-command conninfo+

2024-02-08 Thread Maiquel Grassi
to understand why this happens. It seems curious to me. I'll try to understand this implementation better. I'm continuing the development of "\conninfo+" and now moving on to tests. Tks a lot! Regards, Maiquel Grassi. v10-0001-psql-meta-command-conninfo-plus.patch Description: v10-0001-psql-meta-command-conninfo-plus.patch

RE: Psql meta-command conninfo+

2024-02-08 Thread Maiquel Grassi
stgres/blob/fdfb92c0307c95eba10854196628d88e6708901e/src/bin/psql/tab-complete.c In v9, I started the documentation work and am open to suggestions. > "I can do a more thorough review of the code when you add the > documentation and tests to the patch." Soon I'll be developing the tests. And that will be welcome. Thanks a lot! Regards, Maiquel Grassi. v9-0001-psql-meta-command-conninfo-plus.patch Description: v9-0001-psql-meta-command-conninfo-plus.patch

RE: Psql meta-command conninfo+

2024-02-08 Thread Maiquel Grassi
> On 07.02.24 21:13, Maiquel Grassi wrote: >> >> I believe in v7 patch we have a quite substantial meta-command feature. >> >> > Thanks for implementing this. I find it very handy. > > I was just wondering if a "permission denied" error for non-

RE: Psql meta-command conninfo+

2024-02-08 Thread Maiquel Grassi
> 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 a

RE: Psql meta-command conninfo+

2024-02-07 Thread Maiquel Grassi
> Hi, Maiquel! > > On 07.02.2024 17:47, Maiquel Grassi wrote: > "Also, it seems that the verbose parameter in the listConnectionInformation > is unnecessary." > Could you point out exactly the line or code snippet you are referring to? > +bool > +listConnect

RE: Psql meta-command conninfo+

2024-02-07 Thread Maiquel Grassi
This is a good idea about extended connection info. On 07.02.2024 07:13, Maiquel Grassi wrote: SELECT ... current_user AS "User", This will be inconsistent with \conninfo. \conninfo returns authenticated user (PQuser), not the current_user. It might be worth showing cu

RE: Psql meta-command conninfo+

2024-02-07 Thread Maiquel Grassi
On 2024-02-07 05:13 +0100, Maiquel Grassi wrote: > On Tue, Feb 06, 2024 at 09:45:54PM +0000, Maiquel Grassi wrote: > > My initial idea has always been that they should continue to appear > > because \conninfo+ should show all the things that \conninfo shows and

RE: Psql meta-command conninfo+

2024-02-06 Thread Maiquel Grassi
On Tue, Feb 06, 2024 at 09:45:54PM +, Maiquel Grassi wrote: > My initial idea has always been that they should continue to appear > because \conninfo+ should show all the things that \conninfo shows and > add more information. I think that's the purpose of the 'plus.'

RE: Psql meta-command conninfo+

2024-02-06 Thread Maiquel Grassi
On Tue, Feb 06, 2024 at 03:06:05PM -0600, Nathan Bossart wrote: > On Tue, Feb 06, 2024 at 08:52:09PM +0000, Maiquel Grassi wrote: >> I made the adjustment in the code and updated the patch. I believe this >> is the format suggested by you all. Would this be it? >

RE: Psql meta-command conninfo+

2024-02-06 Thread Maiquel Grassi
On Tue, Feb 06, 2024 at 08:52:09PM +, Maiquel Grassi wrote: > I made the adjustment in the code and updated the patch. I believe this > is the format suggested by you all. Would this be it? I was thinking something more like SELECT pg_catalog.current_database() AS &qu

RE: Psql meta-command conninfo+

2024-02-06 Thread Maiquel Grassi
On 2024-02-06 19:19 +0100, Nathan Bossart wrote: > On Tue, Feb 06, 2024 at 05:27:01PM +0000, Maiquel Grassi wrote: > > postgres=# \conninfo+ > > Current Connection Information > >Attribute| Value > > + >

Psql meta-command conninfo+

2024-02-06 Thread Maiquel Grassi
Hi, I'm seeking to improve the \conninfo meta-command in psql. Currently, it provides limited information about the current connection. I believe that expanding it using the concept of "plus" [+] could ease the work of DBAs, SysAdmins, DevOps, etc., who manage a large volume of databases

RE: Current Connection Information

2024-01-26 Thread Maiquel Grassi
Hi Aleksander, >>I assume you wanted to reply to the mailing list and add me to cc: >>(aka "Reply to All") but sent the e-mail off-list by mistake, so >>quoting it here: Yes, tks for that. >>IMO it's worth trying submitting the patch, if your time permits it of course. I've been spending a

Current Connection Information

2024-01-24 Thread Maiquel Grassi
Hi, It would be viable and appropriate to implement a unified function that provides important information about the current connection? Just an example: "Current Connection Informations". I implemented it in PL/pgSQL to demonstrate the idea, see on GitHub:

RE: New Window Function: ROW_NUMBER_DESC() OVER() ?

2024-01-17 Thread Maiquel Grassi
Even if a workable patch for that is presented, should we accept it? I'm having a hard time believing that this requirement is common enough to justify more than a microscopic addition of complexity. This whole area is devilishly complicated already, and I can think of a bunch of improvements that

RE: New Window Function: ROW_NUMBER_DESC() OVER() ?

2024-01-16 Thread Maiquel Grassi
As far as I see your proposal, you want to allow something that is undefined to be reversed. I don't think this is a good idea at all. As mentioned by others, you should have ORDER BY clauses and just add a DESC. * Okay, now I'm convinced of that. If you were looking for something to

RE: New Window Function: ROW_NUMBER_DESC() OVER() ?

2024-01-16 Thread Maiquel Grassi
As far as I see your proposal, you want to allow something that is undefined to be reversed. I don't think this is a good idea at all. As mentioned by others, you should have ORDER BY clauses and just add a DESC. If you were looking for something to optimize in this rough area, then perhaps

RE: New Window Function: ROW_NUMBER_DESC() OVER() ?

2024-01-16 Thread Maiquel Grassi
But as you are the one arguing for the new feature demonstrating that the status quo is deficient is your job. --//-- I performed these three tests(take a look below) quite simple but functional, so that we can get an idea of the performance. Apparently, we have a higher cost in using

RE: New Window Function: ROW_NUMBER_DESC() OVER() ?

2024-01-16 Thread Maiquel Grassi
The people in this community are quite capable and willing to write a contrary opinion to mine. Not sure how to make “this new proposed function shouldn’t be added to core”, and trying to explain why not, non-oppressive. I can add “thank you for taking the time to try and improve PostgreSQL”

RE: New Window Function: ROW_NUMBER_DESC() OVER() ?

2024-01-16 Thread Maiquel Grassi
However, initially, I have one more obstacle in your feedback. If I use count(*) over() - row_number() over(), it gives me an offset of one unit. To resolve this, I need to add 1. This way, simulating a reverse row_number() becomes even more laborious. I don’t really understand why you think

RE: New Window Function: ROW_NUMBER_DESC() OVER() ?

2024-01-16 Thread Maiquel Grassi
You can do: -(ROW_NUMBER() OVER ()) AS descending (note “-“ in front) I don't have a base column to use for "order by," I think that’s the main issue: what (semantically) does row_number() mean in that case? You could equally well generate random numbers? --//-- What I want to do is

RE: New Window Function: ROW_NUMBER_DESC() OVER() ?

2024-01-16 Thread Maiquel Grassi
I doubt it is materially different, you need that count regardless so the effort is expended no matter if you put it in an SQL expression or build it into the window function. But as you are the one arguing for the new feature demonstrating that the status quo is deficient is your job.

RE: New Window Function: ROW_NUMBER_DESC() OVER() ?

2024-01-16 Thread Maiquel Grassi
Hi, Count() over() - row_number() over() But if my dataset is significantly large? Wouldn't calling two window functions instead of one be much slower? Is count() over() - row_number() over() faster than row_number_desc() over()? Maiquel.

RE: New Window Function: ROW_NUMBER_DESC() OVER() ?

2024-01-16 Thread Maiquel Grassi
enumeration "row_number desc" function? Regards, Maiquel O. Grassi. De: David G. Johnston Enviado: terça-feira, 16 de janeiro de 2024 11:30 Para: Maiquel Grassi Cc: pgsql-hack...@postgresql.org Assunto: Re: New Window Function: ROW_NUMBER_DESC() OVER