CentOS 5.4 + PostgreSQL 8.1.23 설치 :: 2013/04/22 17:29

<PostgreSQL Install>

  • 의존 라이브러리 설치

yum -y install zlib curl gcc g++ cpp gcc-c++ compat-gcc-34-g77 libxml2 libxml2-devel gd gd-devel freetype freetype-devel libpng libpng-devel libjpeg libjpeg-devel fontconfig  fontconfig-devel mhash mhash-devel libmcrypt libmcrypt-devel openssl openssl-devel gmp gmp-devel flex libtermcap-devel ncurses-devel libc-client-devel bzip2-devel termcap libtermcap gdbm-devel readline-devel zlib-devel tcl-devel python-devel


  • PostgreSQL 8.1.23 설치

./configure --prefix=$HOME/pgsql

make && make install


  • PostgreSQL 초기화

Initdb -D $HOME/pgsql/data


  • PostgreSQL DB 시작

bin/pg_ctl -D $HOME/pgsql/data -l logfile start


  • Database 생성

bin/createdb database_name


  • PostgreSQL SQL Console 사용

bin/psql database_name


  • PostgreSQL SQL Console 종료

\q


  • PostgreSQL Table 생성

Create table table_name (column_name varchar(10), mod_date TIMESTAMP....);


  • PostgreSQL Column 추가

Alter table table_name ADD column_name varchar(10);


  • PostgreSQL Column 변경

Alter table table_name rename column column_name to new_column_name;


  • 생성한 테이블 조회

Select * from pg_tables where schemaname='public';


  • 테이블의 Column 정보 조회

Select * from information_schema.columns where table_name='table_name';


  • PostgreSQL 사용자 생성

bin/createuser -s username -P

Enter password for new role : xxx


  • PostgreSQL 사용자 조회

select * from pg_user;


  • PostgreSQL User 권한 주기

Grant all on all tables in schema public to user_id;

2013/04/22 17:29 2013/04/22 17:29
Trackback Address :: http://www.yongbi.net/trackback/554
[로그인][오픈아이디란?]
오픈아이디로만 댓글을 남길 수 있습니다
Name
Password
Homepage

Secret
< PREV |  1  |  ...  235  |  236  |  237  |  238  |  239  |  240  |  241  |  242  |  243  |  ...  566  |  NEXT >