- 论坛徽章:
- 0
|
linux 安装了postgresql8.4 ,
现在刚学postgresql,
[root@v1 tool]# su - postgres
-bash-3.2$ -bash-3.2$
-bash-3.2$ psql -l
资料库列表
名称 | 拥有者 | 字元编码 | 排序规则 | Ctype | 存取权限
-----------+----------+----------+----------+-------+-----------------------
mydb | postgres | UTF8 | C | C | -----------》可以看见已经创建好的mydb数据库
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
test | postgres | UTF8 | C | C |
(5 行记录)
下面我打算在数据库里,创建weather表,在表里添加己行数据
-bash-3.2$ psql mydb
psql (8.4.4)
输入 "help" 来获取帮助信息.
mydb=# COPY weather from '/tool/weather.txt'
mydb-# INSERT INTO weather VALUES ('San Francisco', 46, 50, 0.25, '1994-11-27')
mydb-# SELECT * FROM weather ---------------》没有任何显示和报错,不知道哪里问题 ?
[root@v1 tool]# cat /tool/weather.txt
city varchar(80),
temp_lo int, -- 最低气温
temp_hi int, -- 最高气温
prcp real, -- 降水量
date date |
|