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

nodejs的postgresql驱动

Nodejs postgresql 驱动

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

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