首页 > 数据库 >postgresql windows 开发环境搭建

postgresql windows 开发环境搭建

时间:2023-01-04 03:44:25浏览次数:61  
标签:files ... postgresql 单击 文件 windows 复制 Copying 搭建

postgresql windows 开发环境搭建

发布时间:2020-06-29 12:45:05 来源:网络 阅读:2883 作者:pgmia 栏目:数据库

一、软件需求

  1. Windows 7 旗舰版 sp1 X64

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

  3. diffutils-2.8.7-1.exe, 编译之后回归测试使用,需要手工添加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",选择"接受协议",

   单击"next",安装类型"Type",

   安装选项"Add Perl to the PATH environment variable","create Perl file extension association"

   单击"next",单击"install",单击"finish"

   添加 bin目录"C:\Perl64\bin",配置到系统环境变量PATH.

2.安装Windows 平台 diff工具,回归测试使用

    下载diffutils-2.8.7-1.exe安装包,双击安装

    单击"next",选择"接受协议",默认配置,单击"next",...,单击"install",单击"finish"

    把软件安装的bin目录"C:\Program Files (x86)\GnuWin32\bin",配置到系统环境变量PATH中.

 3.安装visual studio ultimate 2013

    下载VS2013_RTM_ULT_CHS.iso,并解压到VS2013_RTM_ULT_CHS目录,解压完成进入这个目录

    双击"vs_ultimate.exe"进行安装,提示IE 8 不兼容建议IE 10 ,单击"继续",

    选择"同意许可",单击"下一步"

    选择安装功能,只选择"用于C++的Microsoft基础类",单击"安装"

    安装成功后,单击"启动",程序界面加载完成,帮助->注册产品,输入产品序列号

4.安装visual assist

  双击"VA_X_Setup2001.exe",只选择"Microsoft visual studio 2013 RC",单击"install"

  单击"确定",安装成功

  5.获取postgresql源码

   解压postgresql-9.6.2.tar.gz到F 盘根目录

  6. 编译安装数据库

开始->所有程序->visual studio 2013->visual studio tools

  目录中双击"VS2013 x64 本机工具命令提示",打开visual studio 2013命令行窗口

   转到"F:\postgresql-9.6.2\src\tools\msvc"目录,

   1) 编译数据库

   执行perl build.pl DEBUG(DEBUG,代表调试模式,如果不加表示非调试模式)

    2) 回归测试,

 perl vcregress.pl check

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

test event_trigger            ... ok

test stats                    ... ok

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

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

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

 All 167 tests passed.

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

  3) 安装数据库

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.

复制了 63 个文件

复制了 1 个文件

复制了 78 个文件

复制了 33 个文件

复制了 9 个文件

复制了 1 个文件

复制了 48 个文件

复制了 6 个文件

复制了 2 个文件

复制了 7 个文件

复制了 13 个文件

复制了 1 个文件

复制了 19 个文件

复制了 25 个文件

复制了 21 个文件

复制了 41 个文件

复制了 2 个文件

复制了 10 个文件

复制了 5 个文件

复制了 14 个文件

复制了 7 个文件

复制了 34 个文件

复制了 50 个文件

复制了 6 个文件

复制了 7 个文件

复制了 77 个文件

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) 初始化数据库

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) 启动数据库

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

server starting

pg数据库已经编译安装并运行起来了,可以正常使用.

执行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=#

问题解答:

装上后再跑执行 perl build.pl报如下错误: Unable to determine Visual Studio version: The nmake version could not be determined. at src/tools/msvc/Mkvcbuild.pm line 86.  这是perl脚本中不能正常识别vs版本造成,该问题历史悠久,不知道pg为什么不修复,要修正很简单,打开msvc目录中 VSObjectFactory.pm文件,把该文件最下面的 DetermineVisualStudioVersion 函数中  if ($output =~ /(\d+)\.(\d+)\.\d+(\.\d+)?$/m) 这行改成if ($output =~ /(\d+)\.(\d+)\.\d+(\.\d+).*$/m)  ,实际就是将 ? 改成.* 即可。

标签:files,...,postgresql,单击,文件,windows,复制,Copying,搭建
From: https://www.cnblogs.com/yaoyangding/p/17023839.html

相关文章

  • PostgreSQL兼容oracle rman备份——pg_rman
    PostgreSQL兼容oraclerman备份——pg_rmanPostgreSQL sql 数据库 postgresql 0、说明PostgreSQL支持多种备份数据的方式,如:SQL转储、文件系统级备份、连续归档。......
  • PostgreSQL citus python环境搭建
    PostgreSQLcituspython环境搭建 精选 原创Janeh10182022-01-0809:19:09博主文章分类:PostgreSQL©著作权文章标签sqlpostgresql数据库文章分类其它数据库阅读数27......
  • postgresql内核开发之Oracle date类型兼容
    postgresql内核开发之Oracledate类型兼容postgresql内核开发 postgresql兼容oracle postgresql 数据库 oracle兼容 开发实战         ORACLE......
  • postgres oracle 兼容,PostgreSQL Oracle 兼容性之 - sys_guid() UUID
    postgresoracle兼容,PostgreSQLOracle兼容性之-sys_guid()UUIDpostgresoracle兼容 背景Oracle使用sys_guid()用来产生UUID值。在PostgreSQL中有类似的......
  • TableMASTER-mmocr运行环境搭建
    TableMASTER-mmocr运行环境搭建pwd:TableMASTER-mmocr-master#conda环境condacreate-nrecordpython=3.81.pytorch#pytorch1.10CUDA10.2pipinstalltorch......
  • 搭建个人Leanote云笔记本
    Leanote是目前为止发现的最有bigger的云笔记,具备markdown输入,代码高亮,多人协作,笔记历史记录,笔记内导航,直接发布为博客等等能力。下载启动MongoDBLeanote依赖MongoDB......
  • spring整合Mybatis | Postgresql为例
    1.创建配置文件jdbc.propertiesjdbc.url=jdbc:postgresql://localhost:5432/postgis_hy?useSSL=falsejdbc.username=postgresjdbc.password=arcgis2.相关依赖<de......
  • Windows下用VS2022编译安装Boost库
    Windows下用VS2022编译安装Boost库下载地址:https://www.boost.org/users/download/解压得到如下文件:  编译安装:打开vs2022命令行工具  切换到boost的目......
  • postgresql用sql查询表结构
      查询sql如下:SELECTa.attnameASfield,t.typnameAStype,CASEWHENt.typlen=-1THENa.atttypmod-4ELSEt.typlen::integerENDASlengthvar,casea.......
  • ELK日志系统:Elasticsearch + Logstash + Kibana 搭建教程 good
     elk中kibna搜索时,如果搜索 包含 单个 双引号 的字符串时:"'/goods"&&"result\":true"  使用双引号包起来作为一个短语搜索"likeGecko"#字段也可以按页面左侧显示......