zoukankan      html  css  js  c++  java
  • PostgreSQL 选择数据库

    数据库的命令窗口

    PostgreSQL 命令窗口中,我们可以命令提示符后面输入 SQL 语句:

    postgres=#
    

    使用 l 用于查看已经存在的数据库:

    postgres=# l
                                 List of databases
       Name    |  Owner   | Encoding | Collate | Ctype |   Access privileges   
    -----------+----------+----------+---------+-------+-----------------------
     postgres  | postgres | UTF8     | C       | C     | 
     runoobdb  | postgres | UTF8     | C       | C     | 
     template0 | postgres | UTF8     | C       | C     | =c/postgres          +
               |          |          |         |       | postgres=CTc/postgres
     template1 | postgres | UTF8     | C       | C     | =c/postgres          +
               |          |          |         |       | postgres=CTc/postgres
    (4 rows)
    

    接下来我们可以使用 c + 数据库名 来进入数据库:

    postgres=# c runoobdb
    You are now connected to database "runoobdb" as user "postgres".
    runoobdb=# 
    

    系统命令行窗口

    在系统的命令行查看,我么可以在连接数据库后面添加数据库名来选择数据库:

    $ psql -h localhost -p 5432 -U postgress testdb
    Password for user postgress: ****
    psql (11.3)
    Type "help" for help.
    You are now connected to database "runoobdb" as user "postgres".
    runoobdb=# 
    

    pgAdmin 工具

    pgAdmin 工具更简单了,直接点击数据库选择就好了,还可以查看一些数据库额外的信息:

  • 相关阅读:
    哈希表-环形链表
    双链表
    文本框值是否为空,有就隐藏提示语,反之显示
    常用正则
    jquery遍历赋值
    动态更改地址栏参数
    截取地址栏参数
    java.lang.NoSuchMethodException
    文字超出范围隐藏,改变隐藏“...”颜色
    网页设定定时自动跳转
  • 原文地址:https://www.cnblogs.com/sanduzxcvbnm/p/13385035.html
Copyright © 2011-2022 走看看