pg

Rails (PG::GroupingError: ERROR: column must appear in the GROUP BY clause or be used in an aggregate function

本小妞迷上赌 提交于 2021-01-29 13:49:32
问题 In my local this query work perfect with sqlite3 def Event.most_like select("events.*, count(like_events.event_id) as likes_count") .joins(:like_events).group(:event_id).order("likes_count DESC").limit(4) end but i got some error when deploy heroku PG::GroupingError: ERROR: column "events.id" must appear in the GROUP BY clause or be used in an aggregate function Can someone help me fix this? 回答1: As the message, all fields in Select clause must appear in the GROUP BY or in aggregate function.

Pg Promise timeout while using express generator format, but works fine with basic express sever

耗尽温柔 提交于 2020-12-16 07:03:20
问题 Pg-promise is Not returning anything for 60s and gets timed out while running server setup with express-generator. There are no error messages. All the routes without db.any or similar query, works fine. The routes with db.* times out. But, the same connection/route/query works perfectly with a simple express app. I am running this from AWS EC2. Here is the test sample express that worked fine. Same route in routes/index.js does not work - gets timed out. const express = require('express');

ceph体系架构总览

橙三吉。 提交于 2020-11-21 15:16:20
一、功能划分 Ceph 的提供了一个根据 RADOS 无限扩展的 Ceph 存储集群,相关内容你可以参阅 REDOS- 一个可伸缩的、可靠的存储服务 PB 级别存储集群。存储集 群客户端和每个 Ceph 的 OSD 守护进程使用 CRUSH 算法有效地计算有关数据位置的信息,而不必依赖于一个查找表。 Ceph 的高层次功能包括 Ceph 的 存储集群,通过 librados 提供了一个原生接口,在 librados 基础上建立一些服务接口。 对应的进程 Monitors 监视器( ceph-mon ), OSDs 对象存储设备( ceph-osd ) , 通过读取配置文件 ceph.conf 实现集群。 1.1 OSD 功能 OSD 可以被抽象为两个组成部分,即系统部分和守护进程( OSD deamon )部分。 OSD 的系统部分本质上就是一台安装了操作系统和文件系统的计算机,其硬件部分至少包括一个单核的处理器、一定数量的内存、一块硬盘以及一张网卡。系统部分由操作系统内核实现,为 ceph 提供接口。 在 RADOS 的运行过程中, cluster map 的更新完全取决于系统的状态变化,而导致这一变化的常见事件只有两种: OSD 出现故障,或者 RADOS 规模扩大。 Cluster Maps 指包含所有的 Map : OSD map,monitor map,placement

I can't do bundle install because of gem pg(0.18.4)

Deadly 提交于 2020-06-29 10:53:45
问题 I am using ec2 on aws and trying to deploy my rails app. I successfully git cloned my app to my ec2-user then tried bundle install but which didn't work because of gem pg. I don't know why I can't do bundle install. I tried several solutions on stack overflow but anything didn't work. need your help. Fetching gem metadata from https://rubygems.org/........... Fetching version metadata from https://rubygems.org/... Fetching dependency metadata from https://rubygems.org/.. Rubygems 2.0.14.1 is

Installing pg 1.1.3 with native extensions fails

梦想与她 提交于 2020-05-16 05:08:40
问题 I am trying to run a bundle install on a rails app. The installation fails on the step: Installing pg 1.1.3 with native extensions Here is the complete error log: current directory: /Users/velinapetrova/.rvm/gems/ruby-2.5.1/gems/pg-1.1.3/ext /Users/velinapetrova/.rvm/rubies/ruby-2.5.1/bin/ruby -r ./siteconf20181118-57661-1vdieox.rb extconf.rb ——with-pg-config=/usr/local/Cellar/postgresql/10.5/bin/pg_config checking for pg_config... yes Using config values from /usr/local/bin/pg_config

Ceph 命令行说明

旧巷老猫 提交于 2020-03-16 14:10:58
某厂面试归来,发现自己落伍了!>>> 一、Scrub流程设置 1、ceph pg dump命令中输出结果"scrub_stamp"列显示scrub的时间,显示PG的当前状态 2、ceph osd set noscrub、ceph osd unset noscrub集群是否进行常规定时scrub操作 3、ceph pg scrub 1.22对PG进行scrub,不受到2中设置影响 二、keyring生成 ceph-authtool --create-keyring /data/mon.0/ceph.mon.keyring --gen-key -n mon. --cap mon 'allow *' ceph auth get-or-create osd.0 mon 'allow rwx' osd 'allow *' -o /data/osd.0/keyring ceph auth get-or-create osd.3 mon 'allow rwx' osd 'allow *' -o /data/osd.3/keyring 三、对象上传,查看 1、上传rados put {object-name} {file-path} --pool=data示例 rados put rbd.py rbd.py --pool=data 2、查看对象的位置 ceph osd map {pool-name

What does pg_resetxlog do? And how does it work?

半城伤御伤魂 提交于 2020-01-22 15:04:30
问题 I have looked at the postgres documentation and the synopsis below is given: pg_resetxlog [-f] [-n] [-ooid ] [-x xid ] [-e xid_epoch ] [-m mxid ] [-O mxoff ] [-l timelineid,fileid,seg ] datadir But at no point in the documentation do they explain what the datadir is. Is it the %postgres-path%/9.0/data or could it be %postgres-path%/9.0/data/pgxlog ? Also, if I want to change my xlog directory, can I simply move the items in my current pg_xlog directory and run the command to point to another