Postgrel 数据库常用命令

    xiaoxiao2025-01-15  12

    CREATE DATABASE dbname;

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

    postgres=# \c testdb; psql (9.2.4) Type "help" for help. You are now connected to database "testdb" as user "postgres". testdb=#

    postgres=# DROP DATABASE testdb; postgres-#

    退出数据库 

    \q

    转载请注明原文地址: https://ju.6miu.com/read-1295510.html
    最新回复(0)