jieshiyeskey@gmail.com
postgres=# create role markgeng password 'Jieshi11gR2' login superuser createdb createrole;@H_404_9@
CREATE ROLE@H_404_9@
@H_404_9@
postgres=# \dg+@H_404_9@
-----------+------------------------------------------------+-----------+-------------@H_404_9@
@H_404_9@
2.创建表空间@H_404_9@
postgres=# create tablespace tsp_users owner markgeng location '/Library/Postgresql/9.2/data/tsp_users';@H_404_9@
postgres=# \db+@H_404_9@
------------+----------+----------------------------------------+-------------------+-------------@H_404_9@
postgres=# create database orcl owner=markgeng tablespace=tsp_users;@H_404_9@
CREATE DATABASE@H_404_9@
postgres=# \l+@H_404_9@
---------------+----------+----------+---------+-------+-----------------------+---------+------------+--------------------------------------------@H_404_9@
4.创建schema@H_404_9@
postgres=# \c orcl markgeng@H_404_9@
Password for user markgeng: @H_404_9@
You are now connected to database "orcl" as user "markgeng".@H_404_9@
orcl=# create schema authorization markgeng;@H_404_9@
CREATE SCHEMA@H_404_9@
orcl=# \dn+@H_404_9@
----------+----------+----------------------+------------------------@H_404_9@
(2 rows)@H_404_9@
5.创建表@H_404_9@
orcl=# create table t1(id int);@H_404_9@
CREATE TABLE@H_404_9@
orcl=# \dt+@H_404_9@
----------+------+-------+----------+---------+-------------@H_404_9@
(1 row)@H_404_9@
orcl=# \d t1@H_404_9@
--------+---------+-----------@H_404_9@
@H_404_9@
@H_404_9@
orcl=# insert into t1 values(1);@H_404_9@
INSERT 0 1@H_404_9@
orcl=# select * from t1;@H_404_9@
----@H_404_9@
(1 row)@H_404_9@