Re: proposal: psql: show current user in prompt

2024-01-29 Thread Pavel Stehule
po 29. 1. 2024 v 10:26 odesílatel Pavel Stehule napsal: > > > ne 28. 1. 2024 v 22:52 odesílatel Jelte Fennema-Nio > napsal: > >> On Sun, 28 Jan 2024 at 20:01, Pavel Stehule >> wrote: >> > There is another reason - compatibility with other drivers. We >> maintain just libpq, but there are

Re: proposal: psql: show current user in prompt

2024-01-29 Thread Pavel Stehule
ne 28. 1. 2024 v 22:52 odesílatel Jelte Fennema-Nio napsal: > On Sun, 28 Jan 2024 at 20:01, Pavel Stehule > wrote: > > There is another reason - compatibility with other drivers. We maintain > just libpq, but there are JDBC, Npgsql, and some native Python drivers. I > didn't checked, but maybe

Re: proposal: psql: show current user in prompt

2024-01-28 Thread Jelte Fennema-Nio
On Sun, 28 Jan 2024 at 20:01, Pavel Stehule wrote: > There is another reason - compatibility with other drivers. We maintain just > libpq, but there are JDBC, Npgsql, and some native Python drivers. I didn't > checked, but maybe they expect GUC with GUC_REPORT flag. This doesn't matter,

Re: proposal: psql: show current user in prompt

2024-01-28 Thread Pavel Stehule
ne 28. 1. 2024 v 10:42 odesílatel Jelte Fennema-Nio napsal: > On Sat, 27 Jan 2024 at 20:44, Pavel Stehule > wrote: > > client_encoding, standard_conforming_strings, server_version, > default_transaction_read_only, in_hot_standby and scram_iterations > > are used by libpq directly, so it can be

Re: proposal: psql: show current user in prompt

2024-01-28 Thread Jelte Fennema-Nio
On Sat, 27 Jan 2024 at 20:44, Pavel Stehule wrote: > client_encoding, standard_conforming_strings, server_version, > default_transaction_read_only, in_hot_standby and scram_iterations > are used by libpq directly, so it can be wrong to introduce the possibility > to break it. libpq could add

Re: proposal: psql: show current user in prompt

2024-01-27 Thread Pavel Stehule
so 27. 1. 2024 v 10:24 odesílatel Jelte Fennema-Nio napsal: > On Sat, 27 Jan 2024 at 08:35, Pavel Stehule > wrote: > > Until now, it is not possible to disable reporting. So clients can > expect so reporting is workable. > > Sure, so if we leave the default as is that's fine. It's not as if >

Re: proposal: psql: show current user in prompt

2024-01-27 Thread Jelte Fennema-Nio
On Sat, 27 Jan 2024 at 08:35, Pavel Stehule wrote: > Until now, it is not possible to disable reporting. So clients can expect so > reporting is workable. Sure, so if we leave the default as is that's fine. It's not as if this GUC would be changed without the client knowing, the client would be

Re: proposal: psql: show current user in prompt

2024-01-26 Thread Pavel Stehule
so 27. 1. 2024 v 0:04 odesílatel Jelte Fennema-Nio napsal: > On Fri, 26 Jan 2024 at 21:35, Pavel Stehule > wrote: > > I see a possibility of disabling reporting as possibly dangerous. > Without reporting encoding you can break psql. So it should be limited just > to few values where is known

Re: proposal: psql: show current user in prompt

2024-01-26 Thread Jelte Fennema-Nio
On Fri, 26 Jan 2024 at 21:35, Pavel Stehule wrote: > I see a possibility of disabling reporting as possibly dangerous. Without > reporting encoding you can break psql. So it should be limited just to few > values where is known behave. I agree that client_encoding is a GUC that likely all

Re: proposal: psql: show current user in prompt

2024-01-26 Thread Pavel Stehule
pá 26. 1. 2024 v 11:40 odesílatel Jelte Fennema-Nio napsal: > On Thu, 25 Jan 2024 at 21:43, Pavel Stehule > wrote: > > 2. using GUC for all reported GUC looks not too readable. Maybe it > should be used just for customized reporting, not for default > > I thought about this too, because indeed

Re: proposal: psql: show current user in prompt

2024-01-26 Thread Jelte Fennema-Nio
On Thu, 25 Jan 2024 at 21:43, Pavel Stehule wrote: > 2. using GUC for all reported GUC looks not too readable. Maybe it should be > used just for customized reporting, not for default I thought about this too, because indeed the default list is quite long. But I decided against it because it

Re: proposal: psql: show current user in prompt

2024-01-26 Thread Pavel Stehule
po 8. 1. 2024 v 6:08 odesílatel vignesh C napsal: > On Tue, 12 Sept 2023 at 14:39, Peter Eisentraut > wrote: > > > > On 11.09.23 13:59, Jelte Fennema wrote: > > > @Tom and @Robert, since you originally suggested extending the > > > protocol for this, I think some input from you on the protocol

Re: proposal: psql: show current user in prompt

2024-01-26 Thread Pavel Stehule
út 12. 9. 2023 v 9:46 odesílatel Peter Eisentraut napsal: > On 11.09.23 13:59, Jelte Fennema wrote: > > @Tom and @Robert, since you originally suggested extending the > > protocol for this, I think some input from you on the protocol design > > would be quite helpful. BTW, this protocol

Re: proposal: psql: show current user in prompt

2024-01-25 Thread Pavel Stehule
Hi čt 11. 1. 2024 v 12:12 odesílatel Jelte Fennema-Nio napsal: > On Tue, 12 Sept 2023 at 09:46, Peter Eisentraut > wrote: > > ISTM that for a purpose like pgbouncer, it would be simpler to add a new > > GUC "report these variables" and send that in the startup message? That > > might not help

Re: proposal: psql: show current user in prompt

2024-01-21 Thread Pavel Stehule
Hi I starting work on this patch - start with rebase Regards Pavel From c7bbdd67898b397143fa314152f32d5ca935c082 Mon Sep 17 00:00:00 2001 From: "ok...@github.com" Date: Sun, 21 Jan 2024 14:23:06 +0100 Subject: [PATCH 1/4] Protocol ReportGUC message This patch implements dynamic reporting

Re: proposal: psql: show current user in prompt

2024-01-11 Thread Jelte Fennema-Nio
On Tue, 12 Sept 2023 at 09:46, Peter Eisentraut wrote: > ISTM that for a purpose like pgbouncer, it would be simpler to add a new > GUC "report these variables" and send that in the startup message? That > might not help with the psql use case, but it would be much simpler. FYI I implemented it

Re: proposal: psql: show current user in prompt

2024-01-07 Thread vignesh C
On Tue, 12 Sept 2023 at 14:39, Peter Eisentraut wrote: > > On 11.09.23 13:59, Jelte Fennema wrote: > > @Tom and @Robert, since you originally suggested extending the > > protocol for this, I think some input from you on the protocol design > > would be quite helpful. BTW, this protocol extension

Re: proposal: psql: show current user in prompt

2023-09-12 Thread Peter Eisentraut
On 11.09.23 13:59, Jelte Fennema wrote: @Tom and @Robert, since you originally suggested extending the protocol for this, I think some input from you on the protocol design would be quite helpful. BTW, this protocol extension is the main reason I personally care for this patch, because it would

Re: proposal: psql: show current user in prompt

2023-09-11 Thread Pavel Stehule
po 11. 9. 2023 v 13:24 odesílatel Jelte Fennema napsal: > On Fri, 8 Sept 2023 at 21:08, Pavel Stehule > wrote: > > ok changed - there is minor problem - almost all PQ functions are of int > type, but ProtocolVersion is uint > > Your current implementation requires using the PG_PROTOCOL macros

Re: proposal: psql: show current user in prompt

2023-09-11 Thread Jelte Fennema
On Mon, 11 Sept 2023 at 13:59, Jelte Fennema wrote: > I think that would make the client code even simpler than it is now. To be clear, I'm not saying we should do this. There's benefits to using a dedicated new message type too (e.g. clearer errors if a proxy like pgbouncer does not understand

Re: proposal: psql: show current user in prompt

2023-09-11 Thread Jelte Fennema
@Tom and @Robert, since you originally suggested extending the protocol for this, I think some input from you on the protocol design would be quite helpful. BTW, this protocol extension is the main reason I personally care for this patch, because it would allow PgBouncer to ask for updates on

Re: proposal: psql: show current user in prompt

2023-09-11 Thread Jelte Fennema
On Fri, 8 Sept 2023 at 21:08, Pavel Stehule wrote: > ok changed - there is minor problem - almost all PQ functions are of int > type, but ProtocolVersion is uint Your current implementation requires using the PG_PROTOCOL macros to compare versions. But clients cannot currently use those macros

Re: proposal: psql: show current user in prompt

2023-09-10 Thread Pavel Stehule
pá 8. 9. 2023 v 21:07 odesílatel Pavel Stehule napsal: > Hi > > Another thing that should be described there is that this falls >> outside of the transaction flow, i.e. it's changes are not reverted on >> ROLLBACK. But that leaves an important consideration: What happens >> when an error occurs

Re: proposal: psql: show current user in prompt

2023-09-08 Thread Pavel Stehule
Hi Another thing that should be described there is that this falls > outside of the transaction flow, i.e. it's changes are not reverted on > ROLLBACK. But that leaves an important consideration: What happens > when an error occurs on the server during handling of this message > (e.g. the GUC

Re: proposal: psql: show current user in prompt

2023-09-08 Thread Pavel Stehule
út 5. 9. 2023 v 13:29 odesílatel Jelte Fennema napsal: > On Tue, 5 Sept 2023 at 05:50, Pavel Stehule > wrote: > > > I prefer to introduce a new function - it is ten lines of code. The form > is not important - it can be a full number or minor number. It doesn't > matter I think. But my opinion

Re: proposal: psql: show current user in prompt

2023-09-05 Thread Jelte Fennema
On Tue, 5 Sept 2023 at 05:50, Pavel Stehule wrote: > I prefer to introduce a new function - it is ten lines of code. The form is > not important - it can be a full number or minor number. It doesn't matter I > think. But my opinion in this area is not strong, and I like to see feedback > from

Re: proposal: psql: show current user in prompt

2023-09-04 Thread Pavel Stehule
po 4. 9. 2023 v 14:24 odesílatel Jelte Fennema napsal: > On Sun, 3 Sept 2023 at 20:58, Pavel Stehule > wrote: > > here is an try > > Overall it does what I had in mind. Below a few suggestions: > > +int > +PQprotocolSubversion(const PGconn *conn) > > Ugh, it's quite annoying that the original

Re: proposal: psql: show current user in prompt

2023-09-04 Thread Pavel Stehule
po 4. 9. 2023 v 14:24 odesílatel Jelte Fennema napsal: > On Sun, 3 Sept 2023 at 20:58, Pavel Stehule > wrote: > > here is an try > > Overall it does what I had in mind. Below a few suggestions: > > +int > +PQprotocolSubversion(const PGconn *conn) > > Ugh, it's quite annoying that the original

Re: proposal: psql: show current user in prompt

2023-09-04 Thread Jelte Fennema
On Sun, 3 Sept 2023 at 20:58, Pavel Stehule wrote: > here is an try Overall it does what I had in mind. Below a few suggestions: +int +PQprotocolSubversion(const PGconn *conn) Ugh, it's quite annoying that the original PQprotocolVersion only returns the major version and thus we need this new

Re: proposal: psql: show current user in prompt

2023-09-03 Thread Pavel Stehule
Hi ne 3. 9. 2023 v 9:59 odesílatel Jelte Fennema napsal: > On Sun, 3 Sept 2023 at 08:24, Pavel Stehule > wrote: > > My personal feeling from this area is that the protocol design is done, > but it is not implemented on libpq level. My feelings can be wrong. The > protocol number is hardcoded

Re: proposal: psql: show current user in prompt

2023-09-03 Thread Jelte Fennema
On Sun, 3 Sept 2023 at 08:24, Pavel Stehule wrote: > My personal feeling from this area is that the protocol design is done, but > it is not implemented on libpq level. My feelings can be wrong. The protocol > number is hardcoded in libpq, so I cannot change it from the client side. No, I

Re: proposal: psql: show current user in prompt

2023-09-03 Thread Pavel Stehule
út 29. 8. 2023 v 14:11 odesílatel Jelte Fennema napsal: > On Mon, 28 Aug 2023 at 15:00, Pavel Stehule > wrote: > + minServerMajor = 1600; > + serverMajor = PQserverVersion(pset.db) / 100; > > Instead of using the server version, we should instead use

Re: proposal: psql: show current user in prompt

2023-08-29 Thread Jelte Fennema
On Mon, 28 Aug 2023 at 15:00, Pavel Stehule wrote: + minServerMajor = 1600; + serverMajor = PQserverVersion(pset.db) / 100; Instead of using the server version, we should instead use the protocol version negotiation that's provided by the

Re: proposal: psql: show current user in prompt

2023-08-28 Thread Pavel Stehule
po 28. 8. 2023 v 13:58 odesílatel Pavel Stehule napsal: > Hi > > >>> >>> >>> But afaict there's no problem with using pqParseInput3() and >>> PQexecFinish() even if the message isn't handled as part of the >>> transaction. Some other messages that pqParseInput3 handles which are >>> not part of

Re: proposal: psql: show current user in prompt

2023-08-28 Thread Pavel Stehule
Hi >> >> >> But afaict there's no problem with using pqParseInput3() and >> PQexecFinish() even if the message isn't handled as part of the >> transaction. Some other messages that pqParseInput3 handles which are >> not part of the transaction are 'N' (Notice) and 'K' (secret key). >> > > I have

Re: proposal: psql: show current user in prompt

2023-08-11 Thread Pavel Stehule
čt 10. 8. 2023 v 16:31 odesílatel Jelte Fennema napsal: > On Thu, 10 Aug 2023 at 14:44, Pavel Stehule > wrote: > > čt 10. 8. 2023 v 14:05 odesílatel Jelte Fennema > napsal: > >> That it is not rolled-back > >> in a case like this? > >> > >> BEGIN; > >> \set PROMPT '%N' > >> ROLLBACK; > > > > >

Re: proposal: psql: show current user in prompt

2023-08-10 Thread Jelte Fennema
On Thu, 10 Aug 2023 at 14:44, Pavel Stehule wrote: > čt 10. 8. 2023 v 14:05 odesílatel Jelte Fennema napsal: >> That it is not rolled-back >> in a case like this? >> >> BEGIN; >> \set PROMPT '%N' >> ROLLBACK; > > > surely not. > > \set is client side setting, and it is not transactional.

Re: proposal: psql: show current user in prompt

2023-08-10 Thread Pavel Stehule
čt 10. 8. 2023 v 14:05 odesílatel Jelte Fennema napsal: > On Tue, 8 Aug 2023 at 07:20, Pavel Stehule > wrote: > > The reason why I implemented separate flow is usage from psql and > independence of transaction state. It is used for the \set command, that > is non-transactional, not SQL. If I

Re: proposal: psql: show current user in prompt

2023-08-10 Thread Jelte Fennema
On Tue, 8 Aug 2023 at 07:20, Pavel Stehule wrote: > The reason why I implemented separate flow is usage from psql and > independence of transaction state. It is used for the \set command, that is > non-transactional, not SQL. If I inject this message to some other flow, I > lose this

Re: proposal: psql: show current user in prompt

2023-08-07 Thread Pavel Stehule
po 31. 7. 2023 v 17:46 odesílatel Jelte Fennema napsal: > On Mon, 24 Jul 2023 at 21:16, Pavel Stehule > wrote: > > I don't understand how it can be possible to do it without. I need to > process possible errors, and then I need to read and synchronize protocol. > I didn't inject > > this

Re: proposal: psql: show current user in prompt

2023-07-31 Thread Jelte Fennema
On Mon, 24 Jul 2023 at 21:16, Pavel Stehule wrote: > I don't understand how it can be possible to do it without. I need to > process possible errors, and then I need to read and synchronize protocol. I > didn't inject > this feature to some oher flow, so I need to implement a complete process.

Re: proposal: psql: show current user in prompt

2023-07-24 Thread Pavel Stehule
Hi po 8. 5. 2023 v 14:22 odesílatel Jelte Fennema napsal: > I'm very much in favor of adding a way to support reporting other GUC > variables than the current hardcoded list. This can be quite useful to > support some amount of session state in connection poolers. > > Some general feedback on

Re: proposal: psql: show current user in prompt

2023-07-15 Thread Pavel Stehule
Hi pá 28. 4. 2023 v 7:00 odesílatel Pavel Stehule napsal: > > > čt 27. 4. 2023 v 7:39 odesílatel Pavel Stehule > napsal: > >> Hi >> >> rebased version + fix warning possibly uninitialized variable >> > > fix not unique function id > > Regards > > Pavel > only rebase > > >> Regards >> >>

Re: proposal: psql: show current user in prompt

2023-07-15 Thread Pavel Stehule
Hi po 8. 5. 2023 v 14:22 odesílatel Jelte Fennema napsal: > I'm very much in favor of adding a way to support reporting other GUC > variables than the current hardcoded list. This can be quite useful to > support some amount of session state in connection poolers. > > Some general feedback on

Re: proposal: psql: show current user in prompt

2023-05-08 Thread Jelte Fennema
I'm very much in favor of adding a way to support reporting other GUC variables than the current hardcoded list. This can be quite useful to support some amount of session state in connection poolers. Some general feedback on the patch: 1. I don't think the synchronization mechanism that you

Re: proposal: psql: show current user in prompt

2023-04-27 Thread Pavel Stehule
čt 27. 4. 2023 v 7:39 odesílatel Pavel Stehule napsal: > Hi > > rebased version + fix warning possibly uninitialized variable > fix not unique function id Regards Pavel > Regards > > Pavel > > diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml index b11d9a6ba3..f774ffa310

Re: proposal: psql: show current user in prompt

2023-04-26 Thread Pavel Stehule
Hi rebased version + fix warning possibly uninitialized variable Regards Pavel diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml index b11d9a6ba3..f774ffa310 100644 --- a/doc/src/sgml/protocol.sgml +++ b/doc/src/sgml/protocol.sgml @@ -5401,6 +5401,43 @@ psql "dbname=postgres

Re: proposal: psql: show current user in prompt

2023-04-11 Thread Pavel Stehule
st 5. 4. 2023 v 18:40 odesílatel Pavel Stehule napsal: > > > st 5. 4. 2023 v 17:47 odesílatel Robert Haas > napsal: > >> On Wed, Apr 5, 2023 at 11:34 AM Pavel Stehule >> wrote: >> > If the GUC_REPORT should not be used, then only one possibility is >> enhancing the protocol, about the

Re: proposal: psql: show current user in prompt

2023-04-05 Thread Pavel Stehule
st 5. 4. 2023 v 17:47 odesílatel Robert Haas napsal: > On Wed, Apr 5, 2023 at 11:34 AM Pavel Stehule > wrote: > > If the GUC_REPORT should not be used, then only one possibility is > enhancing the protocol, about the possibility to read some predefined > server's features from the client. > >

Re: proposal: psql: show current user in prompt

2023-04-05 Thread Robert Haas
On Wed, Apr 5, 2023 at 11:34 AM Pavel Stehule wrote: > If the GUC_REPORT should not be used, then only one possibility is enhancing > the protocol, about the possibility to read some predefined server's features > from the client. > It can be much cheaper than SQL query, and it can be used

Re: proposal: psql: show current user in prompt

2023-04-05 Thread Pavel Stehule
st 5. 4. 2023 v 16:02 odesílatel Robert Haas napsal: > On Wed, Apr 5, 2023 at 9:56 AM Tom Lane wrote: > > Robert Haas writes: > > > On Tue, Apr 4, 2023 at 12:42 PM Tom Lane wrote: > > >> Basically, I want to reject this on the grounds that it's not > > >> useful enough to justify the overhead

Re: proposal: psql: show current user in prompt

2023-04-05 Thread Pavel Stehule
st 5. 4. 2023 v 15:56 odesílatel Tom Lane napsal: > Robert Haas writes: > > On Tue, Apr 4, 2023 at 12:42 PM Tom Lane wrote: > >> Basically, I want to reject this on the grounds that it's not > >> useful enough to justify the overhead of marking the "role" GUC > >> as GUC_REPORT. > > > I agree

Re: proposal: psql: show current user in prompt

2023-04-05 Thread Robert Haas
On Wed, Apr 5, 2023 at 9:56 AM Tom Lane wrote: > Robert Haas writes: > > On Tue, Apr 4, 2023 at 12:42 PM Tom Lane wrote: > >> Basically, I want to reject this on the grounds that it's not > >> useful enough to justify the overhead of marking the "role" GUC > >> as GUC_REPORT. > > > I agree with

Re: proposal: psql: show current user in prompt

2023-04-05 Thread Tom Lane
Robert Haas writes: > On Tue, Apr 4, 2023 at 12:42 PM Tom Lane wrote: >> Basically, I want to reject this on the grounds that it's not >> useful enough to justify the overhead of marking the "role" GUC >> as GUC_REPORT. > I agree with that. I think we need some method for optionally > reporting

Re: proposal: psql: show current user in prompt

2023-04-05 Thread Robert Haas
On Tue, Apr 4, 2023 at 12:42 PM Tom Lane wrote: > Basically, I want to reject this on the grounds that it's not > useful enough to justify the overhead of marking the "role" GUC > as GUC_REPORT. I agree with that. I think we need some method for optionally reporting values, so that stuff like

Re: proposal: psql: show current user in prompt

2023-04-04 Thread Pavel Stehule
út 4. 4. 2023 v 21:11 odesílatel Pavel Stehule napsal: > > > út 4. 4. 2023 v 20:50 odesílatel Pavel Stehule > napsal: > >> >> >> út 4. 4. 2023 v 19:55 odesílatel Tom Lane napsal: >> >>> Pavel Stehule writes: >>> > út 4. 4. 2023 v 18:42 odesílatel Tom Lane napsal: >>> >> Basically, I want to

Re: proposal: psql: show current user in prompt

2023-04-04 Thread Pavel Stehule
út 4. 4. 2023 v 20:50 odesílatel Pavel Stehule napsal: > > > út 4. 4. 2023 v 19:55 odesílatel Tom Lane napsal: > >> Pavel Stehule writes: >> > út 4. 4. 2023 v 18:42 odesílatel Tom Lane napsal: >> >> Basically, I want to reject this on the grounds that it's not >> >> useful enough to justify

Re: proposal: psql: show current user in prompt

2023-04-04 Thread Pavel Stehule
út 4. 4. 2023 v 19:55 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > út 4. 4. 2023 v 18:42 odesílatel Tom Lane napsal: > >> Basically, I want to reject this on the grounds that it's not > >> useful enough to justify the overhead of marking the "role" GUC > >> as GUC_REPORT. The

Re: proposal: psql: show current user in prompt

2023-04-04 Thread Tom Lane
Pavel Stehule writes: > út 4. 4. 2023 v 18:42 odesílatel Tom Lane napsal: >> Basically, I want to reject this on the grounds that it's not >> useful enough to justify the overhead of marking the "role" GUC >> as GUC_REPORT. The problems with it not going to work properly >> with old servers are

Re: proposal: psql: show current user in prompt

2023-04-04 Thread Pavel Stehule
út 4. 4. 2023 v 18:42 odesílatel Tom Lane napsal: > Kirk Wolak writes: > > Changed status to Ready for Committer. (100% Guessing here...) > > Basically, I want to reject this on the grounds that it's not > useful enough to justify the overhead of marking the "role" GUC > as GUC_REPORT. The

Re: proposal: psql: show current user in prompt

2023-04-04 Thread Tom Lane
Kirk Wolak writes: > Changed status to Ready for Committer. (100% Guessing here...) Basically, I want to reject this on the grounds that it's not useful enough to justify the overhead of marking the "role" GUC as GUC_REPORT. The problems with it not going to work properly with old servers are

Re: proposal: psql: show current user in prompt

2023-03-02 Thread Kirk Wolak
On Sat, Feb 4, 2023 at 3:33 PM Pavel Stehule wrote: > Hi > > pá 3. 2. 2023 v 21:43 odesílatel Pavel Stehule > napsal: > >> >> >> pá 3. 2. 2023 v 21:21 odesílatel Tom Lane napsal: >> >>> Pavel Stehule writes: >>> > Both patches are very simple - and they use almost already prepared >>> >

Re: proposal: psql: show current user in prompt

2023-02-04 Thread Pavel Stehule
Hi pá 3. 2. 2023 v 21:43 odesílatel Pavel Stehule napsal: > > > pá 3. 2. 2023 v 21:21 odesílatel Tom Lane napsal: > >> Pavel Stehule writes: >> > Both patches are very simple - and they use almost already prepared >> > infrastructure. >> >> It's not simple at all to make the psql feature

Re: proposal: psql: show current user in prompt

2023-02-03 Thread Pavel Stehule
pá 3. 2. 2023 v 21:21 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > Both patches are very simple - and they use almost already prepared > > infrastructure. > > It's not simple at all to make the psql feature depend on marking > "role" as GUC_REPORT when it never has been before. That

Re: proposal: psql: show current user in prompt

2023-02-03 Thread Tom Lane
Pavel Stehule writes: > Both patches are very simple - and they use almost already prepared > infrastructure. It's not simple at all to make the psql feature depend on marking "role" as GUC_REPORT when it never has been before. That will cause the feature to misbehave when using older servers.

Re: proposal: psql: show current user in prompt

2023-02-03 Thread Pavel Stehule
pá 3. 2. 2023 v 20:42 odesílatel Corey Huinker napsal: > > > On Fri, Feb 3, 2023 at 9:56 AM Pavel Stehule > wrote: > >> Hi >> >> one visitor of p2d2 (Prague PostgreSQL Developer Day) asked if it is >> possible to show the current role in psql's prompt. I think it is not >> possible, but

Re: proposal: psql: show current user in prompt

2023-02-03 Thread Corey Huinker
On Fri, Feb 3, 2023 at 9:56 AM Pavel Stehule wrote: > Hi > > one visitor of p2d2 (Prague PostgreSQL Developer Day) asked if it is > possible to show the current role in psql's prompt. I think it is not > possible, but fortunately (with some limits) almost all necessary work is > done, and the