psql数据导入

第一步:
C:\Program Files\PostgreSQL\8.3\bin>psql -U 用户名 数据库名
第二步:
C:\Program Files\PostgreSQL\8.3\bin>psql -U postgres dc
Password for user postgres:
第三步:
C:\Program Files\PostgreSQL\8.3\bin>psql -U postgres dc
Password for user postgres:
Welcome to psql 8.3.7, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

dc=#
第四步:
C:\Program Files\PostgreSQL\8.3\bin>psql -U postgres dc
Password for user postgres:
Welcome to psql 8.3.7, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

dc=# \i C:/dc.sql
。。。。。。。。。。。。。。。

C:\Program Files\PostgreSQL\8.3\bin>psql -U postgres dc
Password for user postgres:
Welcome to psql 8.3.7, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

dc=# \i C:/dc.sql
SET
SET
SET
SET
SET
SET
psql:C:/dc.sql:16: ERROR: language "plpgsql" already exists
ALTER LANGUAGE
SET
SET
SET
psql:C:/dc.sql:38: ERROR: relation "dcda" already exists
ALTER TABLE
psql:C:/dc.sql:52: ERROR: relation "dcdesktopannouncement_id_seq" already exist
s
ALTER TABLE
ALTER SEQUENCE
setval
--------
12
(1 row)

psql:C:/dc.sql:78: ERROR: relation "dctype" already exists
ALTER TABLE
psql:C:/dc.sql:92: ERROR: relation "dctype_id_seq" already exists
ALTER TABLE
ALTER SEQUENCE
setval
--------
13
(1 row)

psql:C:/dc.sql:119: ERROR: relation "dcuser" already exists
ALTER TABLE
psql:C:/dc.sql:133: ERROR: relation "user_id_seq" already exists
ALTER TABLE
ALTER SEQUENCE
setval
--------
1
(1 row)

ALTER TABLE
ALTER TABLE
ALTER TABLE
psql:C:/dc.sql:190: ERROR: duplicate key value violates unique constraint "pkda
"
CONTEXT: COPY dcda, line 1: "1 wwww 鈥媤www 2010-02-19 18:37:58.734+08
f 1"
psql:C:/dc.sql:211: ERROR: duplicate key value violates unique constraint "pk_d
ctype"
CONTEXT: COPY dctype, line 1: "1 骞冲彴鍏憡"
psql:C:/dc.sql:220: ERROR: duplicate key value violates unique constraint "pk_u
ser"
CONTEXT: COPY dcuser, line 1: "1 admin 123456"
psql:C:/dc.sql:228: ERROR: multiple primary keys for table "dctype" are not all
owed
psql:C:/dc.sql:236: ERROR: multiple primary keys for table "dcuser" are not all
owed
psql:C:/dc.sql:244: ERROR: multiple primary keys for table "dcda" are not allow
ed
psql:C:/dc.sql:252: ERROR: constraint "fpk_dcda_dctype" for relation "dcda" alr
eady exists
REVOKE
REVOKE
GRANT
GRANT
dc=#结束了!!!
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值