zoukankan      html  css  js  c++  java
  • 035.PGSQL-psql元命令 iming 和 psql客户端提示符

    元命令 iming  watch 

      iming  显示执行时间‘

     psql客户端提示符

    mydb=# echo :PROMPT1
    %/%R%#

    %/ 当前数据库名称

    %R 显示 = 

    %#  超级用户显示 >  普通用户显示 #

    %M 数据库服务器别名

    %> 数据库端口号

    %/@%M:%>%R%#

    将PROMPT1 的设置写进 .psqlrc文件,连接数据库库时自动读 .psqlrc文件

    [postgres@s101 /var/lib/pgsql]$nano  ~/.psqlrc

    添加

    set  PROMPT1  '%/@%M:%>%R%#'

    设置前
    [postgres@s101 /home/centos]$psql -U postgres -d postgres -p 5432
    could not change directory to "/home/centos"
    psql (9.2.24, server 13.3)
    WARNING: psql version 9.2, server version 13.0.
             Some psql features might not work.
    Type "help" for help.
    
    postgres=# 
    
    
    
    设置后
    [postgres@s101 /home/centos]$psql -h 192.168.17.101  -U postgres -d postgres -p 5432
    could not change directory to "/home/centos"
    psql (9.2.24, server 13.3)
    WARNING: psql version 9.2, server version 13.0.
             Some psql features might not work.
    Type "help" for help.
    
    postgres@192.168.17.101:5432=#

     

     

  • 相关阅读:
    Examples
    Examples
    Examples
    Examples
    Examples
    Examples
    Examples
    Examples
    Examples
    如何把随机数或者对象添加到ArrayList集合
  • 原文地址:https://www.cnblogs.com/star521/p/15067061.html
Copyright © 2011-2022 走看看