CODE 项目整体迁移至码云平台(https://gitee.com)公告
limite_god / pgsql JavaScript

nodejs的postgresql驱动

Nodejs postgresql 驱动

项目最近一次提交:接近 3 年 前 31ead12f7

文件列表 提交日期 作者 提交信息 提交编号
.settings / 2015-03-19 00:32:13 No_avatar limiteegod 基本函数的使用 212a627f
help / 2015-03-21 02:01:30 No_avatar limiteegod 返回结果格式化 a94ca654
.cproject 2015-03-20 18:05:10 No_avatar LiMing nodejs访问pg的基础实现 0d4cef1e
.gitignore 2015-07-22 15:01:00 No_avatar liming 添加os x编译 c27959f4
.project 2015-03-23 21:37:59 No_avatar limiteegod add all depend files 02d6debd
Column.js 2015-03-24 01:33:15 No_avatar limiteegod 对需要转义的文本进行转义 a4eed3a1
DataBase.js 2015-03-25 21:50:47 No_avatar limiteegod get pool size from config 8bb25087
DbTest.js 2015-03-28 17:01:21 No_avatar limiteegod demo 28a1e2a3
DbUtil.js 2015-04-22 10:04:37 No_avatar LiMing escape 97e3efc9
Makefile_IOS 2015-07-22 15:01:00 No_avatar liming 添加os x编译 c27959f4
Makefile_Linux 2015-07-22 15:01:00 No_avatar liming 添加os x编译 c27959f4
PgConnection.cc 2015-03-23 21:37:59 No_avatar limiteegod add all depend files 02d6debd
PgConnection.h 2015-03-24 01:33:15 No_avatar limiteegod 对需要转义的文本进行转义 a4eed3a1
PgConnectionWrap.cc 2015-03-24 01:33:15 No_avatar limiteegod 对需要转义的文本进行转义 a4eed3a1
PgConnectionWrap.h 2015-03-24 01:33:15 No_avatar limiteegod 对需要转义的文本进行转义 a4eed3a1
PgResult.cc 2015-03-31 00:28:06 No_avatar limiteegod ntuples没有实际作用,删除 bd44d275
PgResult.h 2015-03-21 02:01:30 No_avatar limiteegod 返回结果格式化 a94ca654
PgWorkData.cc 2015-03-23 21:37:59 No_avatar limiteegod add all depend files 02d6debd
PgWorkData.h 2015-03-20 18:05:10 No_avatar LiMing nodejs访问pg的基础实现 0d4cef1e
Pool.js 2015-03-24 01:33:15 No_avatar limiteegod 对需要转义的文本进行转义 a4eed3a1

README.md

1.install nodejs download the nodejs v0.12.1, the address is: https://nodejs.org/dist/v0.12.1/node-v0.12.1.tar.gz

2.install postgressql download the postgresql 9.4.1, the address is: https://ftp/psotgresql.org/pub/source/v9.4.1/postgresql-9.4.1.tar.gz

nodejs的postgresql驱动程序

源码安装postgresql-9.4.1方法

./configure make su make install adduser postgres mkdir /usr/local/pgsql/data chown postgres /usr/local/pgsql/data su - postgres /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 & /usr/local/pgsql/bin/createdb test /usr/local/pgsql/bin/psql test

如果提示readline库未找到 yum -y install readline-devel

如果运行时提示动态库未找到,尝试添加/etc/ld.so.conf.d/pgsql.conf,添加一行/usr/local/pgsql/lib,然后执行ldconfig

__THROW 引起的名称冲突,修改/usr/include/sys/cdefs.h

/* GCC can always grok prototypes. For C++ programs we add throw() to help it optimize the function calls. But this works only with gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions as non-throwing using a function attribute since programs can use the -fexceptions options for C code as well. */

if !defined _cplusplus && __GNUCPREREQ (3, 3)

define THROW __attribute ((nothrow __LEAF))

define THROWNL __attribute ((nothrow))

define NTH(fct) __attribute ((nothrow __LEAF)) fct

else

if defined _cplusplus && __GNUCPREREQ (2,8)

if !no_throw

define __THROW throw ()

define __THROWNL throw ()

define __NTH(fct) __LEAF_ATTR fct throw ()

else

define __THROW

define __THROWNL

define __NTH(fct) fct

endif

else

define __THROW

define __THROWNL

define __NTH(fct) fct

endif

endif

增加了这个变量no_throw,makefile只要定义了这个变量(-Dno_throw),就会忽略__THROW