pg

PostgreSQL and nodejs/pg, return nested JSON

为君一笑 提交于 2019-12-02 08:06:27
问题 I'm using PostgreSQL with nodejs and pg. Everything works fine, but I want to output a result from PostgreSQL as a nested json - as if I was working with MongoDB or similar. My 2 tables from PostgreSQL are: portfolio (id int, name text) cars (portfolio_id int, name text); Is there a "correct" way of returning a JSON object with the following structure: { { name: 'Portfolio #1', cars: { name: 'Car #1', name: 'Car #2' }, { name: 'Portfolio #2', cars: { name: 'Car #3' } } My general way of

Postgres on AZURE Unhandled rejection TimeoutError: ResourceRequest timed out

China☆狼群 提交于 2019-12-02 06:44:11
I have a database postgres on azure, whith General Purpose, 2 vCore(s), 100 GB. at this moment, when i do a simple request to database, database answer me lot of times with message: Unhandled rejection TimeoutError: ResourceRequest timed out at ResourceRequest._fireTimeout (/Project/development/TFS-git/RAILES/railes-backend-api-pt-0317/node_modules/sequelize/node_modules/generic-pool/lib/ResourceRequest.js:62:17) at Timeout.bound (/Project/development/****/*****/*********/node_modules/sequelize/node_modules/generic-pool/lib/ResourceRequest.js:8:15) at ontimeout (timers.js:458:11) at

Ruby on Rails / PostgreSQL - Library not loaded error when starting server

拜拜、爱过 提交于 2019-12-01 19:14:37
Heyo. I apologize in advance if this question has been answered in another thread. I've searched through the site but I didn't find an answer. However, the closest related issue was Ruby on Rails / PostgreSQL - Library not Loaded error when starting server- libq.5.dylib , but it was never resolved, and the answer doesn't help me. I'm trying to get PostgreSQL running on my Mac OSX 10.6.8. I already have Ruby 1.9.3p392 and Rails 3.2.13 installed. Since I've 10.6.8, and PostGresApp requires 10.7+, I tried installing PG using the manual installer (v9.2.3) available here: http://www.enterprisedb

Error requiring pg under rvm with postgres.app

为君一笑 提交于 2019-12-01 18:21:01
I'm using Postgres.app on OS X (10.8.3). I have modified my PATH so that the bin folder for the app is before all others. Rammy:~ phrogz$ which pg_config /Applications/Postgres.app/Contents/MacOS/bin/pg_config I have rvm installed and can install the pg gem without error, but when I go to require it I get an error: Rammy:~ phrogz$ gem -v 1.8.25 Rammy:~ phrogz$ gem install pg Fetching: pg-0.15.1.gem (100%) Building native extensions. This could take a while... Successfully installed pg-0.15.1 1 gem installed Rammy:~ phrogz$ ruby -v -e "require 'pg'" ruby 1.9.3p392 (2013-02-22 revision 39386)

Ruby on Rails / PostgreSQL - Library not loaded error when starting server

丶灬走出姿态 提交于 2019-12-01 18:04:03
问题 Heyo. I apologize in advance if this question has been answered in another thread. I've searched through the site but I didn't find an answer. However, the closest related issue was Ruby on Rails / PostgreSQL - Library not Loaded error when starting server- libq.5.dylib, but it was never resolved, and the answer doesn't help me. I'm trying to get PostgreSQL running on my Mac OSX 10.6.8. I already have Ruby 1.9.3p392 and Rails 3.2.13 installed. Since I've 10.6.8, and PostGresApp requires 10.7+

用VS2010追PostgreSQL源码

女生的网名这么多〃 提交于 2019-12-01 14:58:15
本篇主要讲述了怎么用VS2010追PostgreSQL源码的过程。使用的VS版本是VS 2010英文专业版,PG的版本是postgresql 9.2.2。 首先第一步就是要安装编译好的PostgreSQL(见 VS2010编译PostgreSQL 9.2.2 )。打开黑DOS窗口(运行->cmd),切换到源文件目录postgresql-9.2.2\src\tools\msvc,之后输入命令install 目标目录。目标目录是数据库将要安装的地址,用户自行选定。如下图所示: 运行该命令后会提示Installation complete。这时已用编译好的PG安装成功,在目标目录中将会出现如下目录: 第二步就是初始化数据库。切换到安装目录的bin文件夹下,执行命令initdb 数据库存放的目录。如下图所示: 之后运行命令,数据库会自行进行初始化,初始化后如下图所示: 这里给出如何使用命令的提示,之后按照命令提示输入postgres -D E:/PG/PG/mydb启动服务进程,这时会出现如下图所示的状况,表示服务器端的进程已处于监听状态。 为了使能够调试安装好PG,需要在VS中配置一下,右键postgres工程,点击属性,如下图所示: 在弹出来的对话框中进行如下配置: 其中Command一栏中是想要绑定PG的postgres.exe;Command Arguments一栏填写的是-D

Does Postgres provide a command to flush buffer cache?

只谈情不闲聊 提交于 2019-12-01 10:34:46
Hi Sometimes I need to do some SQL tuning task, I usually do such tests on my test db. After I excute a sql statments, I want to flush the buffer cache which containing SQL statements and sql result, just like the command in Oracle "Alter system flush buffer_cache" Is PG server provide a commond of this? viksit Check out this SO answer, See and clear Postgres caches/buffers? If you're developing on OSX (I haven't tested on linux), you can use purge command to force disk cache to be purged (flushed and emptied). Then run your SQL query again and it should execute as if it were the first time.

Does Postgres provide a command to flush buffer cache?

你说的曾经没有我的故事 提交于 2019-12-01 08:31:56
问题 Hi Sometimes I need to do some SQL tuning task, I usually do such tests on my test db. After I excute a sql statments, I want to flush the buffer cache which containing SQL statements and sql result, just like the command in Oracle "Alter system flush buffer_cache" Is PG server provide a commond of this? 回答1: Check out this SO answer, See and clear Postgres caches/buffers? 回答2: If you're developing on OSX (I haven't tested on linux), you can use purge command to force disk cache to be purged

Installing postgres gem when database is on a different server

可紊 提交于 2019-12-01 02:54:31
问题 My database is on a different server to the application. When I run "bundle" I get the following error: No pg_config... trying anyway. If building fails, please try again with --with-pg-config=/path/to/pg_config How do I set the pg config path if pg is not actually installed on the application server? I have also tried: bundle config build.pg --without-pg_config Thanks 回答1: The Ruby PostgreSQL interface (AKA the pg gem) is just a thin wrapper around the PostgreSQL client C libraries. You need

PG pg_ext load error in rails

北慕城南 提交于 2019-11-30 13:09:17
I recently updated to rails 4.1.6 and ruby 2.1.3p242. I also updated all gems on my system. After creating a new app, I keep getting a pg_ext load file error on running the server. I'm on windows 8 x64 with PostgreSQL 9.3. The pg gem was working fine under my previous RoR installation which was rails 3.2 and ruby 1.9.3. Under the gem's installation directory, I've a 2.0/pg_ext.so file. I tried renaming the folder to 2.1 and ran the server. The result was the same. I assume it's cause Ruby doesn't allow to Require a .so file. Below is the screenshot of the error: Any help would be really