顯示包含「PostgreSQL」標籤的文章。顯示所有文章
顯示包含「PostgreSQL」標籤的文章。顯示所有文章

2013/02/28

PostgreSQL Binary Install in Win7



  • download binary files: http://www.enterprisedb.com/products-services-training/pgbindownload
  • unzip to c:\pgsql
  • create a batch file: setevn.bat:
      set PGHOME=C:\pgsql
      set PATH=%PGHOME%\bin;%path%
      set PGHOST=localhost
      set PGLIB=%PGHOME%\lib
      set PGDATA=%PGHOME%\data
  • as a system administrator to run the "command prompt"
  • execute the following script:
  •           C:\>cd C:\pgsql
      C:\pgsql>setenv.bat
      C:\pgsql>initdb.exe -D %PGDATA% -E UTF8 --locale=C
      C:\pgsql>pg_ctl.exe register -D %PGDATA% -N "PostgreSQL 918"

2012/07/23

Install PostgreSQL 8.2.23 in CentOS 5.8


  1. Download source files from here
  2. Upload files to the CentOS server
  3. Prepare the necessary files
    1. #yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers
  4. #tar -zxf postgresql-8.2.23.tar.gz
  5. #cd postgresql*
  6. #./configure --prefix=/usr/local/pgsql  --without-readline
  7. #make && make install
  8. Setting PostgreSQL config process
    1. create user: #adduser postgres
    2. create password: #passwd postgres
    3. Authorized folder/files: 
      1. #mkdir /usr/local/pgsql/data
      2. #chown -R postgres /usr/local/pgsql
    4. login as postgres: su postgres
    5. initial dataset: /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
    6. edit config
      1. #vi /usr/local/pgsql/data/postgresql.conf
      2. find listen_addresses = ‘localhost’ to listen_addresses = '*'
      3. #vi /usr/local/pgsql/data/pg_hba.conf 
      4. IPv4 local connections:
      5. host    all         all         127.0.0.1/32          trust 
        host    all         all         192.168.1.0/24      password
  9. Update user env. parameters
    1. #vim /var/lib/pgsql/.bash_profile
    2. [ -f /etc/profile ] && source /etc/profile
    3. PGDATA=/usr/local/pgsql/data
      export PATH=/usr/local/pgsql/bin:$PATH
      export PGDATA
  10. Start the service
    1. start SQL service: 
      1. #su - postgres
      2. #/usr/local/pgsql/bin/pg_ctl start -i -D /usr/local/pgsql/data
    2. check SQL status: ps aux | grep postgres
    3. update postgres user
      1. #su - postgres
      2. #psql postgres
      3. #alter user postgres ENCRYPTED PASSWORD 'postgres';

Note that: you have a short cut to figure out:
command line: yum -y install postgresql postgresql-libs postgresql-server

2012/04/12

Uninstall PostgreSQL 8.2 for MAC 10.6.8

Steps to uninstall PostgreSQL 8.4 (Assuming default locations) 

1) Stop the server and remove the service. 

sudo launchctl unload /Library/LaunchDaemons/com.edb.launchd.postgresql-8.4.plist 

2) Remove the plist file. 

sudo rm -f /Library/LaunchDaemons/com.edb.launchd.postgresql-8.4.plist  

3) Remove the Menu Icons 

sudo rm -rf /Applications/PostgreSQL/8.4

4) Remove the Installation Files. 

sudo rm -rf /Library/PostgreSQL/8.4  

5) Remove the postgres user. 

sudo dscl . delete /Users/postgres  

6) Remove the ini file 

sudo rm -f /etc/postgres-reg.ini  


This will uninstall PostgreSQL 8.4 cleanly from your mac. 

NGINX SSL/設定檔案

#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #...