Re: [DEFAULT] Daily digest v1.3954 (22 messages)

Started by Serguei A. Mokhovover 22 years ago4 messages
#1Serguei A. Mokhov
mokhov@cs.concordia.ca

On Wed, 3 Sep 2003 pgsql-hackers-owner@postgresql.org wrote:

Date: Wed, 3 Sep 2003 19:32:52 -0400 (EDT)
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: PostgreSQL Development <pgsql-hackers@postgresql.org>
Subject: Re: Transaction status in default psql prompt?
Message-ID: <200309032332.h83NWqB14879@candle.pha.pa.us>

Peter Eisentraut wrote:

What do people think about adding the transaction status indicator to
the default psql prompt, so it'd look something like this:

peter=# begin;
BEGIN
peter*=# foo;
ERROR: syntax error at or near "foo" at character 1
peter!=# rollback;
ROLLBACK
peter=#

I think many people would find that useful.

Btw., would anyone mind if the code for this indicator where not %T,
but say instead %x, because there is a correspondence between psql's
codes and tcsh's, and tcsh uses %T for the hour of the day, which is
something that someone might want to add someday.

If you take a close look at the output above, you will see that the
prompt shifts one character to the right when you are in a transaction.
That is going to look terrible. I don't think we should have a moving
prompt as a default.

On the contrary, it could show the transaction level for the case of
nested transactions:

foo**=#

could mean you are within the 2nd nested transaction block, which I'd find
convenient.

--
Serguei A. Mokhov | /~\ The ASCII
Computer Science Department | \ / Ribbon Campaign
Concordia University | X Against HTML
Montreal, Quebec, Canada | / \ Email!

"I swear, education is the only industry, where
the consumer is happier when they get less
for their money" -- Julia Timofeev

#2Alvaro Herrera
alvherre@dcc.uchile.cl
In reply to: Serguei A. Mokhov (#1)

On Wed, Sep 03, 2003 at 09:19:33PM -0400, Serguei A. Mokhov wrote:

If you take a close look at the output above, you will see that the
prompt shifts one character to the right when you are in a transaction.
That is going to look terrible. I don't think we should have a moving
prompt as a default.

I agree, probably the "not in a transaction" status should display a
different character.

On the contrary, it could show the transaction level for the case of
nested transactions:

foo**=#

Ugh... pretty ugly. What if you are within the 50th transaction block?
Not that it will be common, but ...

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"There was no reply" (Kernel Traffic)

#3Serguei A. Mokhov
mokhov@cs.concordia.ca
In reply to: Alvaro Herrera (#2)

On Wed, 3 Sep 2003, Alvaro Herrera wrote:

On Wed, Sep 03, 2003 at 09:19:33PM -0400, Serguei A. Mokhov wrote:

If you take a close look at the output above, you will see that the
prompt shifts one character to the right when you are in a transaction.
That is going to look terrible. I don't think we should have a moving
prompt as a default.

I agree, probably the "not in a transaction" status should display a
different character.

On the contrary, it could show the transaction level for the case of
nested transactions:

foo**=#

Ugh... pretty ugly. What if you are within the 50th transaction block?
Not that it will be common, but ...

Make it a two-line thig then ;-) or a number.

-s

#4Doug McNaught
doug@mcnaught.org
In reply to: Serguei A. Mokhov (#3)

"Serguei A. Mokhov" <mokhov@cs.concordia.ca> writes:

On Wed, 3 Sep 2003, Alvaro Herrera wrote:

On Wed, Sep 03, 2003 at 09:19:33PM -0400, Serguei A. Mokhov wrote:

On the contrary, it could show the transaction level for the case of
nested transactions:

foo**=#

Ugh... pretty ugly. What if you are within the 50th transaction block?
Not that it will be common, but ...

Make it a two-line thig then ;-) or a number.

And how often is anyone going to do a 50-level-deep transaction
interactively in psql anyhow? If the prompt is too long you should be
using a script anyway...

Anyhow, it's moot at the moment since we don't have nesting.

-Doug