Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdcdbb5a

Browse files
committed
Add %x to default PROMPT1 and PROMPT2 in psql
%d can be used to track if the current connection is in a transactionblock or not, and adding it by default to the prompt has the advantageto not need a modification of .psqlrc, something not possible dependingon the environment.This discussion has happened across various sources, and there was astrong consensus in favor of this change.Author: Vik FearingReviewed-by: Fabien CoelhoDiscussion:https://postgr.es/m/09502c40-cfe1-bb29-10f9-4b3fa7b2bbb2@2ndquadrant.com
1 parent43e0841 commitdcdbb5a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

‎doc/src/sgml/logicaldecoding.sgml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ postgres=# SELECT * FROM pg_logical_slot_get_changes('regression_slot', NULL, NU
9292
(0 rows)
9393

9494
postgres=# BEGIN;
95-
postgres=# INSERT INTO data(data) VALUES('1');
96-
postgres=# INSERT INTO data(data) VALUES('2');
97-
postgres=# COMMIT;
95+
postgres=*# INSERT INTO data(data) VALUES('1');
96+
postgres=*# INSERT INTO data(data) VALUES('2');
97+
postgres=*# COMMIT;
9898

9999
postgres=# SELECT * FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL);
100100
lsn | xid | data

‎doc/src/sgml/ref/psql-ref.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4332,7 +4332,7 @@ testdb=> \set PROMPT1 '%[%033[1;33;40m%]%n@%/%R%[%033[0m%]%# '
43324332

43334333
To insert a percent sign into your prompt, write
43344334
<literal>%%</literal>. The default prompts are
4335-
<literal>'%/%R%# '</literal> for prompts 1 and 2, and
4335+
<literal>'%/%R%x%# '</literal> for prompts 1 and 2, and
43364336
<literal>'&gt;&gt; '</literal> for prompt 3.
43374337
</para>
43384338

‎src/bin/psql/settings.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
#defineDEFAULT_EDITOR_LINENUMBER_ARG "+"
2424
#endif
2525

26-
#defineDEFAULT_PROMPT1 "%/%R%# "
27-
#defineDEFAULT_PROMPT2 "%/%R%# "
26+
#defineDEFAULT_PROMPT1 "%/%R%x%# "
27+
#defineDEFAULT_PROMPT2 "%/%R%x%# "
2828
#defineDEFAULT_PROMPT3 ">> "
2929

3030
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp