블로그 이미지
bedbmsguru

Notice

Recent Post

Recent Comment

Recent Trackback

Archive

calendar

1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
  • total
  • today
  • yesterday
2020. 3. 16. 17:04 PostgreSQL

1. psql 의 prompt 설정 하기

 

--사용자의 홈디렉토리에서 설정할 것

vi ~/.psqlrc

 

 

\set PROMPT1 '%M:%> %n@%/%R%#%x '

 

  • %M 서버 hostname
  • %> DB port
  • %n session username
  • %/  current database
  • %R  whether you’re in single-line mode (^) or disconnected (!) but is normally =
  • %# refers to whether you’re a superuser (#) or a regular user (>)
  • %x  refers to the transaction status – usually blank unless in a transaction block (*)

2. color 설정

\set PROMPT1 '%M:%[%033[1;31m%]%>%[%033[0m%] %n@%/%R%#%x '

  • 32 for green
  • 33 for yellow
  • 34 for blue
  • 35 for magenta
  • 36 for cyan
  • 37 for white

 

https://www.digitalocean.com/community/tutorials/how-to-customize-the-postgresql-prompt-with-psqlrc-on-ubuntu-14-04

'PostgreSQL' 카테고리의 다른 글

pg_stat_statements  (0) 2021.06.03
blocking 체크  (0) 2020.07.24
pg_settings 칼럼 설명  (0) 2020.05.20
postgresql.conf 파일 설정  (0) 2020.04.27
Heidi SQL 접속시 LIBPQ.DLL 오류 해결  (0) 2020.03.24
posted by bedbmsguru