Configuration and use of postgresql in cygwin (zz)

Source: Internet
Author: User
Tags psql
Author: Takhisis @ smth
Http://computer.mblogger.cn/abyss/

Be sure to keep yourself busy and don't want to worry about anything. Don't think about anything... Don't think about it.

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 into concepts that only became available in some other cial database systems much later.

PostgreSQL is an open-source descendant of this original Berkeley code. It supports sql92 and sql99 and offers limit modern features.

PostgreSQL Homepage

Http://www.postgresql.org/

The following describes the target cygwin and PostgreSQL versions:

 
$ Cygcheck-CD cygwin postgresqlcygwin package informationpackage versioncygwin 1.5.10-3 PostgreSQL 7.4.3-1

Starting from PostgreSQL 7.4.2-1, cygwin uses cygserver to support it instead of the previous cygipc.

Cygserver configuration generation/etc/cygserver. conf
 
/Usr/bin/cygserver-config
Set Environment Variables

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
Start cygserver
 
/Usr/sbin/cygserver &
PostgreSQL configuration PostgreSQL Initialization
 
Initdb-d $ data_dir
Start PostgreSQL

Use-I to open the TCP port

 
Postmaster-I-d $ data_dir &
Start Psql
 
Psql template1
Create Database and table
$ 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 (# 'Ha ha' Cn_test (# ); Insert 25337 1cn_test = # Select * from students; Id | Name ---- + ---------------------------------- 1 | Haha (1 row) cn_test = #/Q
Databases (DBS) and SQL with PostgreSQL

This is a perfect place for SQL beginners.
Http://www.felixgers.de/teaching/ SQL /index.html

However, the documentation provided by PostgreSQL is quite detailed... at least in terms of basic usage.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.