zoukankan      html  css  js  c++  java
  • PostgreSQL 常用基本操作

    基本操作

    # 查看帮助
    psql --help
    
    
    # 进入数据库
    psql -U admin -d testdb
    
    
    # 查看命令
    ?
    
    
    # 列出数据库
    l
    
    
    # 列出表
    dt
    
    
    
    # 选择数据库
    c 数据库

    命令开头符号的区别

    执行创建数据库命令(命令要以分号结尾)

    =#

      可以正常执行, 创建库 表操作

     

    testdb=# create database testdb;

     

     

    -#

      上一个命令没有完成(最后没有加;号 命令行还在等着输入命令), 这种情况下, ? l等命令还是可以操作的

      如果最后不加分号, 数据库则无法创建

    testdb=# create
    testdb-# database
    testdb-# testdb2
    testdb-# ;
    # 创建成功
    CREATE DATABASE

    常用操作

    # 新建数据库
    create database testdb;
    
    # 删除数据库
    drop database testdb;
    
    
    # 新建数据库表
    create table testtable;
    
    # 删除数据库表
    drop table testtable;
    
    # 格式化输出查询(使用x on 或 x auto)
    app=# x on
    Expanded display is on.
    
    app=# x auto
    Expanded display is used automatically.
  • 相关阅读:
    TensorFlow object detection API
    bounding box的简单理解
    OverFeat学习
    tensorflow调试tfdbg
    2018.7-2019.4记录
    人工智能未来读后感 ----by RayKurzweil
    matlab exe
    神经网络的基础
    研究生的论文
    卷积神经网络经验
  • 原文地址:https://www.cnblogs.com/mswei/p/13044162.html
Copyright © 2011-2022 走看看