-bash-3.2$ psql -U playboy -d playboy #指定用户登录指定数据库 -bash-3.2$ psql -d playboy_test -U playboy -f /var/lib/pgsql/data/playboy2013.sql #将上面导入表删除后,在把playboy的数据库导入到playboy_test中去,权限归属playboy playboy_test=> \dt; #查看所有表 List of relations Schema | ...
List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges | Size | Tablespace | Description ---+---+---+---+---+---+---+---+--- --- mytest | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | | 7137 kB | pg_default | postgres | postgres | U...
# 切换到postgres用户su postgres# 重启数据库pg_ctl restart# 查看数据库运行的状态pg_ctl status# 进入数据库psql# 展示psql (15.7) Type"help"forhelp. postgres=# List of databasespostgres-# \lList of databases Name | Owner | Encoding | Locale Provider | Collate | Ctype | ICU Locale | ICU Ru...
postgres=# \l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges ---+---+---+---+---+--- postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +| | | | ...
List all databases with additional information # \l+ List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges | Size | Tablespace | Description ---+---+---+---+---+---+---+---+--- learning | jarvis | UTF8 | C | UTF-8 | | 492 MB | pg_default ...
List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges ---+---+---+---+---+--- postgres | pgxc | UTF8 | C | C | template0 | pgxc | UTF8 | C | C | =c/pgxc + | | | | | pgxc=CTc/pgxc template1 | pgxc | UTF8 | C | C...
List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges---+---+---+---+---+---postgres | postgres | UTF8 | en_IN | en_IN | template0 | postgres | UTF8 | en_IN | en_IN | =c/postgres + | | | ...
列举数据库,相当于mysql的show databases 代码语言:javascript 代码运行次数:0 运行 AI代码解释 ambari=> \l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges ---+---+---+---+---+--- ambari | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =Tc/post...
change directory to "/root" Password for user ambari: psql (9.2.18) Type "help" for help. 7.列举数据库...列举数据库,相当于mysql的show databases ambari=> \l List of databases Name...(4 rows) 8.列举表 列举表,相当于mysql的show tables(当前已经在ambari数据库) ambari=> \dt List of ...
Add databases, tables, and users. Run SQL queries in the database. Retrieve metadata information about the database objects. Now that you know what psql is, follow the steps below to run the Postgres list users \du command: Open the terminal. Connect to your PostgreSQL server with the foll...