Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

PostgreSQL DBA (137)-PG 13 (Allow invisible PROMPT2 in psql)

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

In PG 12 or below, psql distinguishes the same command with line breaks by configuring PROMPT2, and in PG 13, all lines of SQL can be aligned to the left by setting% w.

PG 12

[local:/data/pg12]: 5432 pg12@testdb=#\! Cat .psqlrc\ set PROMPT1'% n@%/%R%#%x% >% n@%/%R%#%x'\ set PROMPT2'% n@%/%R%#%x'\ x auto [local:/data/pg12]: 5432 pg12@testdb=# select pg12@testdb-# 1 + 1;? column?-2 (1 row)

PG 13

[local]: 5130 pg13@masterdb=# select version () Version -- PostgreSQL 13devel on x86_64-pc-linux-gnu Compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16), 64-bit (1 row) [local]: 5130 pg13@masterdb=#\! Cat .psqlrc\ set PROMPT1'% n@%/%R%#%x% >% n@%/%R%#%x'\ set PROMPT2'% n@%/%R%#%x'\ x auto [local]: 5130 pg13@masterdb=# [local]: 5130 pg13@masterdb=#\ set PROMPT2'% w' [local]: 5130 pg13@masterdb=# select 1 + 1;? column?-2 (1 row) [local]: 5130 pg13@masterdb=#

references

Waiting for PostgreSQL 13-Allow invisible PROMPT2 in psql.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report