PostgreSQL笔记

修改表字段属性:

alter table 表名 alter column 字段名 type 新的类型:

alter table picture alter column description type text;

\d 表名 查看表结构

切换数据库:

\c cmd cmd  : \c dbname owner

数据库授权:

 GRANT ALL PRIVILEGES ON DATABASE cmd TO cmd;


PostgreSQL环境变量设置:

su - postgres

vi .bash_profile

export PGHOME=/opt/PostgreSQL/9.4/

export PGDATA=/home/postgres/data

PATH=$PATH:$HOME/.local/bin:$HOME/bin:$PGHOME/bin

你可能感兴趣的:(PostgreSQL笔记)