pg

    0热度

    1回答

    我有以下疑问: 问题1:在下面的代码,调用游泳池的任何功能之前,我该如何确保游泳池是活动? const { Pool } = require('pg'); var pool = new Pool(); //global variable, used by multiple modules function f1(){ /* Check here if pool is ac

    2热度

    1回答

    亲爱的社区和有希望的, 我正在建立一个网站/服务器pg-promise。 我使用postgre角色/组登录进行身份验证。 我不知道我是否正确地做了这些事情,但我希望每个用户都使用自己的postgres连接来查询数据库。 因此,在实践中,我们为每个用户在连接时创建连接(如果它尚不存在)。 要做到这一点,我创建了一个池对象与一个丑陋的“假承诺”和PGUSER对象: var pgPool = funct

    0热度

    1回答

    我一直在试图设置我的新的MacBook Pro(Sierra 10.12.5)使用Rails - 我已经安装了Ruby 2.4.1,Rails 5.0.2和PSQL 9.6.3 。我在安装pg 0.20.0时遇到了麻烦,但我可以通过Homebrew来完成。 现在我无法通过本地主机运行任何我MVCS的,因为我说: PG Connection Bad - fe_sendauth: no passwor

    0热度

    1回答

    我想部署我的Rails应用程序到Heroku。我创建了一个应用程序,并成功地推动它,但是当我做 heroku run rake db:migrate 我收到此错误 > rake aborted! > LoadError: libruby.so.2.3: cannot open shared object file: No such file or directory - > /app/

    0热度

    2回答

    我刚刚创建了一个新应用程序并安装了'pg'gem,创建了一个psql用户和数据库,并创建了一个database.yml文件。但是,服务器不会接受我的密码,即使它是正确的。 下面是我跑到我创建用户和数据库的命令: Project$ sudo -i -u postgres [email protected]:~$ psql postgres=# CREATE USER Project WITH P

    7热度

    2回答

    似乎有很多文档(例如https://devcenter.heroku.com/articles/heroku-postgresql#connecting-in-node-js,但也包括此站点在内的其他地方)表明正确使用pg.js节点包进行连接的方法是使用pg.connect。不过,我试图(后与我的实际代码前面的问题)通过使用上述Heroku的文档上显示的确切的代码进行测试: var pg = re

    1热度

    2回答

    我试图恢复备份到我的本地主机来审查数据 - 以便我确实可以确保备份工作。我使用Heroku,postgres和rails。 我干净地安装了应用程序,所以localhost数据库中没有数据。我运行db:reset和db:migrate。 这里是我试图使用pg_restore的字符串: pg_restore --verbose --clean --no-acl --no-owner -h localh

    1热度

    1回答

    由node.js开发。我正在使用pg-promise。 插入以下数据时出现问题。 我想在下表中插入多行数据。 create table info ( id varchar(20) not null, name varchar(20) not null, createdate timestamp with time zone not null ) 我插入了下面的数据

    2热度

    1回答

    所以我这个表称为SeasonRate create_table "season_rates", force: :cascade do |t| t.string "title" t.datetime "from_date" t.datetime "to_date" t.float "rate" t.integer "property_type_id"

    0热度

    1回答

    每次我尝试运行 bundle exec rake db:create db:migrate 我得到这个错误: PG::InvalidParameterValue: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII) HINT: Use the sam