- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我无法在 Windows 中通过命令行访问 PostgreSQL。虽然我可以创建和更新数据库,通过 PGAdminIII 访问它们,并推送到 Heroku,但我无法直接通过我的命令行使用 psql 命令。
当我尝试使用命令创建数据库时
$ createdb mydb
如 PG documentation 中所述, 我收到消息
createdb: command not found
文档表明,在这种情况下,“PostgreSQL 未正确安装。尝试使用绝对路径调用命令。”果然,我可以通过输入文件的直接路径来创建数据库:
$ c:/postgreSQL/9.1/bin/createdb mydb
这是否意味着可以重新配置路径以正确连接?还是我需要重新安装?重装了好几次,都没能设置正确的路径。我目前已将/bin 和/lib 路径添加到我的系统和用户 (:Umezo) 路径,但仍然无法从命令行访问。
User variables for umezo
variable name: Path
variable value: C:\PostgreSQL\9.1\bin; C:\PostgreSQL\9.1\lib
System variables
variable name: Path
variable value: C:\PostgreSQL\9.1\bin; C:\PostgreSQL\9.1\lib
如能提供任何有关我如何修复分期付款的信息或反馈,我们将不胜感激。
我的信息如下:
我主要关注这些来源 here和 here .我安装了 32 位版本的 9.1,因为一些消息来源提示 64 位版本存在问题。
PG download version: Installer Version 9.1 Win x86-32
Operating System: Windows 7 (64 bit)
pg_hba.conf
#TYPE DATABASE USER CIER-ADDRESS METHOD
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
postgresql.conf
# - Connection Settings -
listen_addresses = '*'
port = 5432
max_connections = 100
pg_ident.conf
# *Everything is commented out*
登录角色 Umezo #from PGAdminIII 中的属性窗口
Properties/Role name: Umezo
Properties/Can login: "check"
Role privileges: all categories "check"
最佳答案
我也遇到了这个问题。我正在使用 Git Bash ,因此在 Windows 上使用 Unix 风格的 $ 提示符。
$ rails db
Couldn't find database client: psql, psql.exe. Check your $PATH and try again.
这是我做的:
在 Windows 7 中,导航至:
Control Panel
All Control Panel Items
System
Advanced System Settings
Environment Variables
from the System Variables box select "PATH"
Edit...
然后将此字符串附加到现有的 PATH 变量值:
;C:\Program Files\PostgreSQL\9.2\bin
然后单击“确定”三次退出菜单。
现在,关闭控制台并重新启动它。
导航回您的 Rails 应用的目录。就我而言,这是通过以下方式完成的:
$ cd rails_projects/sample_app
然后,再试一次:
$ 轨道数据库
来源:
How do I put PostgreSQL /bin directory on my path in Windows?
http://railscasts.com/episodes/342-migrating-to-postgresql?view=asciicast
关于windows - 为 Postgres 工具设置 Windows PATH,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11460823/
我想知道这里是否有人有安装 Postgres-XL 的经验,新的开源多线程版本的 PostgreSQL。我计划将一组 1-2 TB 的数据库从常规 Postgres 9.3 迁移到 XL,并且想知道这
我想创建一个 postgres 备份脚本,但我不想使用 postgres 用户,因为我所在的 unix 系统几乎没有限制。我想要做的是在 crontab 上以 unix 系统(网络)的普通用户身份运行
我正在尝试编写一个 node-postgres 查询,它采用一个整数作为参数在间隔中使用: const query = { text: `SELECT foo
如何在不使用 gui 的情况下停止特定的 Postgres.app 集群。 我想使用 bash/Terminal.app 而不是 gui 我还应该指出,Postgres 应用程序有一个这样的菜单 如果
关闭。这个问题是opinion-based .它目前不接受答案。 想要改进这个问题? 更新问题,以便 editing this post 可以用事实和引用来回答它. 关闭 9 年前。 Improve
我正在使用 docker 运行 Postgres 图像。它曾经在 Windows10 和 Ubuntu 18.04 上运行没有任何问题。 在 Ubuntu 系统上重新克隆项目后,它在运行 docker
我正在使用 python(比如表 A)将批处理 csv 文件加载到 postgres。我正在使用 pandas 将数据上传到更快的 block 中。 for chunk in pd.read_csv(
所以是的,标题说明了一切,我需要以某种方式将 DB 从源服务器获取到新服务器,但更重要的是旧服务器正在崩溃 :P 有什么方法可以将它全部移动到新服务器并导入它? 旧服务器只是拒绝再运行 Postgre
这主要是出于好奇而提出的问题。我正在浏览 Postgres systemd 单元文件,以了解 systemd 可以做什么。 Postgres 有两个 systemd 单元文件。一个用于代替 syste
从我在 pg_hba.conf 中读到的内容,我推断,为了确保提示我输入 postgres 用户的密码,我应该从当前的“对等”编辑 pg_hba.conf 的前两个条目的方法'到'密码'或'md5',
我已连接到架构 apm。 尝试执行函数并出现以下错误: ERROR: user mapping not found for "postgres" 数据库连接信息说: apm on postgres@
我在 ubuntu 12.04 服务器上,我正在尝试安装 postgresql。截至目前,我已成功安装它但无法配置它。我需要创建一个角色才能继续前进,我在终端中运行了这个命令: root@hostna
我无法以“postgres”用户身份登录到“postgres”数据库。操作系统:REHL 服务器版本 6.3PostgreSQL 版本:8.4有一个数据库“jiradb”用作 JIRA 6.0.8 的
我正在尝试将现有数据库导入 postgres docker 容器。 这就是我的处理方式: docker run --name pg-docker -e POSTGRES_PASSWORD=*****
我们的 Web 应用程序在 postgres 9.3 和 Grails 2.5.3 上运行。当我们重新启动 postgres (/etc/init.d/postgresql restart) 并访问网
我想构建 postgres docker 容器来测试一些问题。我有: postgres 文件的归档文件夹(/var/lib/postgres/data/) 将文件夹放入 docker postgres
我有一个名为“stuff”的表,其中有一个名为“tags”的 json 列,用于存储标签列表,还有一个名为“id”的列,它是表中每一行的主键。我正在使用 postgres 数据库。例如,一行看起来像这
我对 sqlalchemy-psql 中的锁定机制是如何工作的感到非常困惑。我正在运行一个带有 sqlalchemy 和 postgres 的 python-flask 应用程序。由于我有多个线程处理
我(必须)使用 Postgres 8.4 数据库。在这个数据库中,我创建了一个函数: CREATE OR REPLACE FUNCTION counter (mindate timestamptz,m
我已经使用 PostgreSQL 几天了,它运行良好。我一直在通过默认的 postgres 数据库用户和另一个具有权限的用户使用它。 今天中午(在一切正常之后)它停止工作,我再也无法回到数据库中。我会
我是一名优秀的程序员,十分优秀!