postgresqlwindows開(kāi)發(fā)環(huán)境搭建

一、軟件需求

創(chuàng)新互聯(lián)建站主營(yíng)托克遜網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營(yíng)網(wǎng)站建設(shè)方案,成都APP應(yīng)用開(kāi)發(fā),托克遜h5微信小程序開(kāi)發(fā)搭建,托克遜網(wǎng)站營(yíng)銷推廣歡迎托克遜等地區(qū)企業(yè)咨詢

  1. Windows 7 旗艦版 sp1 X64

  2. ActivePerl-5.22.3.2204-MSWin32-x64-401627.exe

  3. diffutils-2.8.7-1.exe, 編譯之后回歸測(cè)試使用,需要手工添加bin路徑到PATH

  4. visual studio ultimate 2013,VS2013_RTM_ULT_CHS.iso

  5. visual assist,代碼格式化工具

  6. postgresql-9.6.2.tar.gz,pg源碼

二、安裝IDE工具

1.安裝Perl

  下載ActivePerl-5.22.3.2204-MSWin32-x64-401627.exe,雙擊安裝

   單擊"next",選擇"接受協(xié)議",

   單擊"next",安裝類型"Type",

   安裝選項(xiàng)"Add Perl to the PATH environment variable","create Perl file extension association"

   單擊"next",單擊"install",單擊"finish"

   添加 bin目錄"C:\Perl64\bin",配置到系統(tǒng)環(huán)境變量PATH.

2.安裝Windows 平臺(tái) diff工具,回歸測(cè)試使用

    下載diffutils-2.8.7-1.exe安裝包,雙擊安裝

    單擊"next",選擇"接受協(xié)議",默認(rèn)配置,單擊"next",...,單擊"install",單擊"finish"

    把軟件安裝的bin目錄"C:\Program Files (x86)\GnuWin32\bin",配置到系統(tǒng)環(huán)境變量PATH中.

 3.安裝visual studio ultimate 2013

    下載VS2013_RTM_ULT_CHS.iso,并解壓到VS2013_RTM_ULT_CHS目錄,解壓完成進(jìn)入這個(gè)目錄

    雙擊"vs_ultimate.exe"進(jìn)行安裝,提示IE 8 不兼容建議IE 10 ,單擊"繼續(xù)",

    選擇"同意許可",單擊"下一步"

    選擇安裝功能,只選擇"用于C++的Microsoft基礎(chǔ)類",單擊"安裝"

    安裝成功后,單擊"啟動(dòng)",程序界面加載完成,幫助->注冊(cè)產(chǎn)品,輸入產(chǎn)品序列號(hào)

4.安裝visual assist

  雙擊"VA_X_Setup2001.exe",只選擇"Microsoft visual studio 2013 RC",單擊"install"

  單擊"確定",安裝成功

  5.獲取postgresql源碼

   解壓postgresql-9.6.2.tar.gz到F 盤根目錄

  6. 編譯安裝數(shù)據(jù)庫(kù)

開(kāi)始->所有程序->visual studio 2013->visual studio tools

  目錄中雙擊"VS2013 x64 本機(jī)工具命令提示",打開(kāi)visual studio 2013命令行窗口

   轉(zhuǎn)到"F:\postgresql-9.6.2\src\tools\msvc"目錄,

   1) 編譯數(shù)據(jù)庫(kù)

   執(zhí)行perl build.pl DEBUG(DEBUG,代表調(diào)試模式,如果不加表示非調(diào)試模式)

    2) 回歸測(cè)試,

 perl vcregress.pl check

   .............

test event_trigger            ... ok

test stats                    ... ok

============== shutting down postmaster               ==============

============== removing temporary instance            ==============

=======================

 All 167 tests passed.

=======================

  3) 安裝數(shù)據(jù)庫(kù)

F:\postgresql-9.6.2\src\tools\msvc>perl install.pl f:\pg962

Installing version 9.6 for debug in f:\pg962

Copying build output files......................................................

..........................................................................

Copying config files......

Copying Import libraries...

Copying contrib data files......................................................

................................................................................

...........................................................................

Copying Public headers......

Copying Libpq headers..

Copying Libpq internal headers..

Copying Internal headers...

Copying Server headers....

Copying Grammar header.

......................

Copying PL/pgSQL header.

復(fù)制了 63 個(gè)文件

復(fù)制了 1 個(gè)文件

復(fù)制了 78 個(gè)文件

復(fù)制了 33 個(gè)文件

復(fù)制了 9 個(gè)文件

復(fù)制了 1 個(gè)文件

復(fù)制了 48 個(gè)文件

復(fù)制了 6 個(gè)文件

復(fù)制了 2 個(gè)文件

復(fù)制了 7 個(gè)文件

復(fù)制了 13 個(gè)文件

復(fù)制了 1 個(gè)文件

復(fù)制了 19 個(gè)文件

復(fù)制了 25 個(gè)文件

復(fù)制了 21 個(gè)文件

復(fù)制了 41 個(gè)文件

復(fù)制了 2 個(gè)文件

復(fù)制了 10 個(gè)文件

復(fù)制了 5 個(gè)文件

復(fù)制了 14 個(gè)文件

復(fù)制了 7 個(gè)文件

復(fù)制了 34 個(gè)文件

復(fù)制了 50 個(gè)文件

復(fù)制了 6 個(gè)文件

復(fù)制了 7 個(gè)文件

復(fù)制了 77 個(gè)文件

Copying ECPG headers...............

Copying ECPG informix headers...

Copying timezone names..........

Copying timezone sets...

Copying BKI files...

Copying SQL files..

Copying Information schema data.

Generating conversion proc script...

Generating timezone files...

Generating tsearch script..................

Copying Stopword files..............

Copying Dictionaries sample files.........

Copying PL Extension files...

Installation complete.

F:\postgresql-9.6.2\src\tools\msvc>

4) 初始化數(shù)據(jù)庫(kù)

F:\postgresql-9.6.2\src\tools\msvc>cd /d f:\pg962\bin

f:\pg962\bin>initdb.exe -D ../data

The files belonging to this database system will be owned by user "Administrator

".

This user must also own the server process.

The database cluster will be initialized with locale "Chinese (Simplified)_Peopl

e's Republic of China.936".

Encoding "GBK" implied by locale is not allowed as a server-side encoding.

The default database encoding will be set to "UTF8" instead.

initdb: could not find suitable text search configuration for locale "Chinese (S

implified)_People's Republic of China.936"

The default text search configuration will be set to "simple".

Data page checksums are disabled.

creating directory ../data ... ok

creating subdirectories ... ok

selecting default max_connections ... 100

selecting default shared_buffers ... 128MB

selecting dynamic shared memory implementation ... windows

creating configuration files ... ok

running bootstrap script ... ok

performing post-bootstrap initialization ... ok

syncing data to disk ... ok

WARNING: enabling "trust" authentication for local connections

You can change this by editing pg_hba.conf or using the option -A, or

--auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

    "pg_ctl" -D "../data" -l logfile start

f:\pg962\bin>

5) 啟動(dòng)數(shù)據(jù)庫(kù)

f:\pg962\bin>pg_ctl.exe -D "../data" -l logfile start

server starting

pg數(shù)據(jù)庫(kù)已經(jīng)編譯安裝并運(yùn)行起來(lái)了,可以正常使用.

執(zhí)行select version();查看下版本

f:\pg962\bin>psql postgres

psql (9.6.2)

Type "help" for help.

postgres=# \du

                                     List of roles

   Role name   |                         Attributes                         | Me

mber of

---------------+------------------------------------------------------------+---

--------

 Administrator | Superuser, Create role, Create DB, Replication, Bypass RLS | {}

postgres=# select version();

                           version

-------------------------------------------------------------

 PostgreSQL 9.6.2, compiled by Visual C++ build 1800, 64-bit

(1 row)

postgres=#

問(wèn)題解答:

裝上后再跑執(zhí)行 perl build.pl報(bào)如下錯(cuò)誤: Unable to determine Visual Studio version: The nmake version could not be determined. at src/tools/msvc/Mkvcbuild.pm line 86.  這是perl腳本中不能正常識(shí)別vs版本造成,該問(wèn)題歷史悠久,不知道pg為什么不修復(fù),要修正很簡(jiǎn)單,打開(kāi)msvc目錄中 VSObjectFactory.pm文件,把該文件最下面的 DetermineVisualStudioVersion 函數(shù)中  if ($output =~ /(\d+)\.(\d+)\.\d+(\.\d+)?$/m) 這行改成if ($output =~ /(\d+)\.(\d+)\.\d+(\.\d+).*$/m)  ,實(shí)際就是將 ? 改成.* 即可。

當(dāng)前題目:postgresqlwindows開(kāi)發(fā)環(huán)境搭建
文章位置:http://muchs.cn/article20/jcpoco.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供定制網(wǎng)站、品牌網(wǎng)站建設(shè)、網(wǎng)站策劃、網(wǎng)站內(nèi)鏈外貿(mào)網(wǎng)站建設(shè)、靜態(tài)網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

微信小程序開(kāi)發(fā)