PostgreSQL 에 scott/tiger 유저를 생성한후에, 테이블들을 생성해보겠습니다.
[postgres@olmaster:~/9.2/data]$ psql -d postgres -U postgres
Password for user postgres:
Null display is "NULL".
Timing is on.
Pager is always used.
psql (9.2.1)
Type "help" for help.
postgres@[local]:5432 postgres#SQL> CREATE ROLE scott LOGIN password 'tiger';
CREATE ROLE
Time: 12.084 ms
postgres@[local]:5432 postgres#SQL> CREATE DATABASE scottdb OWNER=scott;
CREATE DATABASE
Time: 402.028 ms
postgres@[local]:5432 postgres#SQL> \q
[postgres@olmaster:~/9.2/data]$
[postgres@olmaster:~/9.2/data]$ psql -U scott -d scottdb -f scott.sql # -f 다음에 첨부화일 지정
Password for user scott:
.........
[postgres@olmaster:~/9.2/data]$ psql -U scott -d scottdb
Password for user scott:
Null display is "NULL".
Timing is on.
Pager is always used.
psql (9.2.1)
Type "help" for help.
scott@[local]:5432 scottdb#SQL> \d # 생성된 테이블들을 확인할수 있습니다.
List of relations
Schema | Name | Type | Owner
--------+----------+-------+-------
public | bonus | table | scott
public | dept | table | scott
public | dummy | table | scott
public | emp | table | scott
public | salgrade | table | scott
(5 rows)
scott@[local]:5432 scottdb#SQL>
pgAdmin 으로 접속하여 확인해보겠습니다.
생성된 테이블들이 public schema 에 잘 생성되어 있네요^^