cygwin下postgresql的配置及使用(zz)

來源:互聯網
上載者:User
author: takhisis@smth
http://computer.mblogger.cn/abyss/

一定要讓自己忙起來什麼也不想, 什麼也不要想, 不要想...不準想.

About PostgreSQL

PostgreSQL is an object-relational database management system (ORDBMS) based on POSTGRES, Version 4.2, developed at the University of California at Berkeley Computer Science Department. POSTGRES pioneered many concepts that only became available in some commercial database systems much later.

PostgreSQL is an open-source descendant of this original Berkeley code. It supports SQL92 and SQL99 and offers many modern features.

PostgreSQL首頁

http://www.postgresql.org/

下面的敘述所針對的cygwin及postgresql版本:

$ cygcheck -cd cygwin postgresqlCygwin Package InformationPackage              Versioncygwin               1.5.10-3postgresql           7.4.3-1

從postgresql 7.4.2-1開始, cygwin使用cygserver來支援它而不是從前的cygipc.

cygserver的配置 產生/etc/cygserver.conf
/usr/bin/cygserver-config
設定環境變數

Please keep in mind, that a client application which wants to use the services provided by cygserver *must* have the environment variable CYGWIN set so that it contains the word "server". So, if you don't need any other special CYGWIN setting, just set it to "server".

It is advisable to add this setting to the Windows system environment.

export CYGWIN=server
啟動cygserver
/usr/sbin/cygserver &
postgresql的配置 postgresql的初始化
initdb -D $data_dir
啟動postgresql

注意使用-i開啟tcp連接埠

postmaster -i -D $data_dir &
啟動psql
psql template1
建立資料庫及表
$ createdb --encoding=EUC_CN cn_testCREATE DATABASE$ psql cn_testWelcome to psql 7.4.3, the PostgreSQL interactive terminal.Type:  /copyright for distribution terms       /h for help with SQL commands       /? for help on internal slash commands       /g or terminate with semicolon to execute query       /q to quitcn_test=# /l       List of databases   Name    | Owner  | Encoding-----------+--------+----------- cn_test   | $user | EUC_CN template0 | $user | SQL_ASCII template1 | $user | SQL_ASCII(3 rows)cn_test=# create table students (cn_test(# id int,cn_test(# name char(30)cn_test(# );CREATE TABLEcn_test=# /dt         List of relations Schema |   Name   | Type  | Owner--------+----------+-------+-------- public | students | table | $user(1 row)cn_test=# /d students      Table "public.students" Column |     Type      | Modifiers--------+---------------+----------- id     | integer       | name   | character(30) |cn_test=# insert into students values (cn_test(# 1,cn_test(# '呵呵'cn_test(# );INSERT 25337 1cn_test=# select * from students ; id |               name----+----------------------------------  1 | 呵呵(1 row)cn_test=# /q
Databases (DBs) and SQL with PostgreSQL

這個地方對sql初學者很適合的樣子
http://www.felixgers.de/teaching/sql/index.html

不過其實postgresql內建的文檔也蠻詳細的了...至少在基本的使用方面.

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.