运行Ubuntu17.10和我有一个问题运行Postgres。几周前就开始工作了,但现在我有了这个问题。
sudo su postgres psql
/usr/bin/psql: line 19: use: command not found
/usr/bin/psql: line 20: use: command not found
/usr/bin/psql: line 21: use: command not found
/usr/bin/psql: line 22: use: command not found
/usr/bin/psql: psql: line 24: syntax
我想编写一个R脚本,它将使用Bash中的PostgreSQL选项将ESRI自动发送到shp2pgsql。
# in Bash
shp2pgsql -I -s Port Shapefile schema.table | psql DB
# in R
Command<-c("-I","-s",Port,"shapefile","schema.table","|","psql","DB")
system2("shp2pgsql",Command,wait=FALSE
我已经安装了PostgreSQL,它工作正常。但是,当我恢复备份时,我收到错误-bash: psql: command not found
[root@server1 ~]# su postgres
[postgres@server1 root]$ psql -f all.sql
bash: psql: command not found
[postgres@server1 root]$
我做错了什么?
我有一个工作的WAL运输设置与应用WAL文件的热备用从属服务器。
当我创建pg_standby触发器文件时,它会立即检测到这一点,但需要大约10-15分钟才能真正准备好接受连接。大部分时间都花在等待.history文件上。
触发器文件为空,因此应执行“智能”故障转移。我能做些什么来使故障转移(更)更快吗?
日志输出:
WAL file not present yet. Checking for trigger file...
trigger file found: smart failover
LOG: could not open file "pg_xlog/00000001000
我正在运行以下proc_open函数。加载页面时,我会得到以下错误:
Use of undefined constant STDOUT - assumed 'STDOUT'`
如何正确设置STDOUT和STSDERR?
PHP片段
$cmd = 'psql -p 5432 -d nominatim';
$descriptorspec = array(
0 => array("pipe", "r"), // stdin is a pipe that the child will read from
1 =>
我先运行vagrant up命令,然后再运行vagrant ssh命令,然后尝试运行psql命令
$ vagrant ssh
Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-75-generic i686)
0 packages can be updated.
0 updates are security updates
Last login: Sat Jun 17 02:55:00 2017 from 10.0.2.2
vagrant@vagrant:~$ psql
-bash: psql: command not found
`
我尝试了
我在使用Mac的计算机上使用PostgreSQL安装了单击安装程序。然后我尝试使用PostgreSQL命令访问psql,但它似乎是不可用的。
我收到这样的信息:
psql
-bash: psql: command not found
我需要安装更多的东西吗?或者如何配置PostgreSQL以便在我的计算机上使用它?
我遵循以下步骤
clean./configuresudo make
表演->
PostgreSQL installation complete.
但是如果输入psql就会说->
Command 'psql' not found, but can be installed with:
apt install postgresql-client-common
Please ask your administrator.
我不想从apt安装-get安装只想从源代码安装所有东西。
我试图使用通常的命令heroku pg:psql访问我的Heroku数据库,但是我得到了:
! No app specified.
! Run this command from an app folder or specify which app to use with --app <app name>
虽然我是从应用程序文件夹运行它。如果我尝试heroku pg:psql --app APPNAME,我得到:
Resource not found
最近有什么变化吗?
我刚在我的苹果电脑上安装了,但它不能正常工作。我完成了安装,应用程序图标在菜单栏上,它显示它正在侦听端口5432,然而,如果我尝试从命令行运行它,就会发生这种情况:
~ $ psql
zsh: correct 'psql' to 'sl' [nyae]? n
zsh: command not found: psql
我之前通过Homebrew安装了PostgreSQL,但在安装Postgres.app之前删除了它。我正在运行Mac OS X Lion。
我很感谢任何人的帮助,我真的很想让PostgreSQL在我的机器上运行。
我试图从shell中执行一个PSQL,问题是-它返回错误"command not found“。我有一个shell脚本,其中有几行代码:
ID3=`more DATA/Id3.txt`
psql -h localhost test test -Atc "SELECT id, reference, timestamp FROM restricted WHERE id='`$ID3`'"
在Id3.txt中只有ID。当直接通过prompt编写和执行psql命令时-没有任何问题,并返回正确的值。使用.sh文件执行时,会出现错误“未找到命令”。我不知道为什么。
我正在尝试构建一个安装脚本来自动创建开发环境,但是我在尝试通过管道或使用psql的-c修饰符时遇到了问题。
我试过了:
sudo su postgres psql -c "ALTER ROLE postgres WITH password 'pass'"
和
sudo su postgres psql -c "ALTER ROLE postgres WITH password 'pass';"
两者都显示"ALTER: command not found“
我也尝试过管道,但我不能正确地将它与su结合起来
例句:我试过这样
我想直接从本地机器通过ssh执行psql查询。
在远程计算机中,该命令工作正常:
psql -U USER -d DATABASE -c "select A,B,C from TABLE where A='string1';"
现在,当使用:
ssh user@host "psql -U USER -d DATABASE -c "select A,B,C from TABLE where A='string1';""
我会犯错误,例如:
psql: warning: extra command-line argum
我正在尝试激活Munin的Postgresql插件。当我运行munin-node-configure --suggest | grep postgres时,我得到以下输出:
postgres_bgwriter | no | no [DBD::Pg not found, and cannot do psql yet]
postgres_cache_ | no | no [DBD::Pg not found, and cannot do psql yet]
postgres_checkpoints | no | no [DBD::Pg