pg

ActiveRecord::StatementInvalid: PG InFailedSqlTransaction

走远了吗. 提交于 2019-11-27 10:05:19
问题 I am trying to create an ActiveRecord Object.But I'm getting this error while creating it. (0.1ms) ROLLBACK ActiveRecord::StatementInvalid: PG::InFailedSqlTransaction: ERROR: current transaction is aborted, commands ignored until end of transaction block Any ideas folks regarding the issue. 回答1: None of the other answers fix the root cause of the issue. The problem is that when Postgres raises an exception, it poisons future transactions on the same connection. The fix is to rollback the

Cannot install pg gem in Mavericks with Postgres.app

你说的曾经没有我的故事 提交于 2019-11-27 10:02:46
I am trying to install the pg gem for use with Postgres.app on my local machine. I am running Mavericks. Postgres.app is installed and running fine, but I cannot get the gem to work. I've done the following: Used the command 'env ARCHFLAGS="-arch x86_64" gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/MacOS/bin/pg_config' from the Postgres.app documentation Updated Homebrew and installed the Apple GCC 4.2 Installed the Xcode developer tools Updated my $PATH to reference both the Postgres.app bin and lib directories All with no success. Here is the specific error message

Ceph Jewel版本三副本读操作流程

谁说胖子不能爱 提交于 2019-11-27 08:04:39
一、主OSD读处理流程 OSD::ms_fast_dispatch() |__OSD::dispatch_session_waiting() |__OSD::dispatch_op_fast() |__OSD::handle_op() |__OSD::get_pg_or_queue_for_pg() 找到OpRequest中对应的PG和Pool信息 |__OSD::enqueue_op() |__PG::queue_op() |__OSD::ShardedThreadPool::ShardedWQ::queue() 将PG和Op一起放入队列中 OSD::ShardedOpWQ::_process() 负责处理OSD::ShardedThreadPool::ShardedWQ队列中的Op |__PGQueueable::RunVis::operator()(const OpRequestRef &op) |__OSD::dequeue_op() |__ReplicatedPG::do_request() |__检查当前PG是否处于flush或peering状态,若是则将op放入waiting_for_peered队列中等待PG变成可用状态 |__检查当前PG是否处于Active状态,若不是则将op放入waiting_for_active队列中 |_

Ceph Jewel版本三副本写操作流程

十年热恋 提交于 2019-11-27 08:04:25
一、主OSD写处理流程 OSD::ms_fast_dispatch() |__OSD::dispatch_session_waiting() |__OSD::dispatch_op_fast() |__OSD::handle_op() |__OSD::get_pg_or_queue_for_pg() 找到OpRequest中对应的PG和Pool信息 |__OSD::enqueue_op() |__PG::queue_op() |__OSD::ShardedThreadPool::ShardedWQ::queue() 将PG和Op一起放入队列中 OSD::ShardedOpWQ::_process() 负责处理OSD::ShardedThreadPool::ShardedWQ队列中的Op |__PGQueueable::RunVis::operator()(const OpRequestRef &op) |__OSD::dequeue_op() |__ReplicatedPG::do_request() |__检查当前PG是否处于flush或peering状态,若是则将op放入waiting_for_peered队列中等待PG变成可用状态 |__检查当前PG是否处于Active状态,若不是则将op放入waiting_for_active队列中 |_

linux安装postgresql数据库

笑着哭i 提交于 2019-11-27 07:46:29
本文提供数据库安装脚本,有部分需要优化,就是脚本中的方法执行存在前后依赖,但是代码里面没有对上一个执行结果进行判断,如果提供的路径和安装包没有问题,脚本能够正常执行 1 #!/bin/bash 2 # install postgre 3 # base_path=$(cd $(dirname ${BASH_SOURCE[0]}); pwd ) 4 base_path="/opt" 5 # Pg database installation package name 6 pg_name="./postgresql-9.6.15-1-linux-x64-binaries.tar.gz" 7 # Pg database installation path 8 pg_deploy_path="$base_path/postgreSQL" 9 # Directory of data stored in the pg database 10 pg_data_path="${pg_deploy_path}/data" 11 # Directory of data stored in the pg database 12 user_name='pguser' 13 14 15 # unzip pg 16 function pg_untar(){ 17 if [ -d ${pg_deploy_path}

connection.select_value only returns strings in postgres with pg gem

随声附和 提交于 2019-11-27 06:54:35
问题 I'm converting a rails app from using mysql (mysql2 gem) to postgres (pg gem). With mysql, ActiveRecord::Base.connection.select_value calls return values typed according to the data, for example: > ActiveRecord::Base.connection.select_value("SELECT COUNT(*) FROM errors") => 86 > ActiveRecord::Base.connection.select_value("SELECT exception FROM errors where id=565") => "TechTalk.Genome.SqlExecutionException" > ActiveRecord::Base.connection.select_value("SELECT id FROM errors where id=565") =>

gem install pg doesn't work on OSX Lion

自作多情 提交于 2019-11-27 05:09:33
问题 There are variations of this question bouncing around SO, but none of them seem to have an answer that solves my problem. I am running OSX Lion (10.7.3). The latest XCode is installed. I've installed Postgres using the Postgres.app package from postgresapp.com. But when I try to install the pg gem, I get a failure: $ gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/MacOS/bin/pg_config Building native extensions. This could take a while... ERROR: Error installing pg:

ERROR: Failed to build gem native extension on Mavericks

自作多情 提交于 2019-11-27 01:47:41
I'm attempting to run bundle in my Rails project on OSX 10.9. It fails when getting to the pg gem with this error: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /Users/kyledecot/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb checking for pg_config... no No pg_config... trying anyway. If building fails, please try again with --with-pg-config=/path/to/pg_config checking for libpq-fe.h... yes checking for libpq/libpq-fs.h... yes checking for pg_config_manual.h... yes checking for PQconnectdb() in -lpq... yes checking for PQconnectionUsedPassword()... yes

Trying to set up postgres for ror app, getting error - fe_sendauth: no password supplied

为君一笑 提交于 2019-11-27 00:36:57
问题 Getting: An error has occurred: Error connecting to the server: fe_sendauth: no password supplied Settings in database.yml are the same as the app setup on other machines. How can I set things up so that I don't need a password hardcoded? I can view the db ok using PgAdmin-III. I'd rather not have the password in database.yml as other machines using this app don't have/need it, so it seems likely to be something about my Pg install. 回答1: You need to change your change your pg_hba.conf . Here

gem install pg --with-pg-config works, bundle fails

给你一囗甜甜゛ 提交于 2019-11-26 21:22:30
WhenI run (as root) gem install pg -v '0.12.0' -- --with-pg-config=/usr/pgsql-9.1/bin/pg_config I get the following output: #-> gem instal pg -v '0.12.0' -- --with-pg-config=/usr/pgsql-9.1/bin/pg_config Building native extensions. This could take a while... Successfully installed pg-0.12.0 1 gem installed Installing ri documentation for pg-0.12.0... Installing RDoc documentation for pg-0.12.0... #-> When I run bundle install: Installing pg (0.12.0) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /usr/local/rvm/rubies/ruby-1.9.2-p290/bin