草庐IT

postgresql - Docker - 如何在 postgres 容器中运行 psql 命令?

我想在postgres镜像中使用psql以便在数据库上运行一些查询。但不幸的是,当我附加到postgres容器时,我得到了psql命令未找到的错误...对我来说,如何在容器中运行postgresql查询或命令是一个谜。如何在postgres容器中运行psql命令?(我是Docker世界的新人)我使用Ubuntu作为主机,并且我没有在主机上安装postgres,而是使用postgres容器。docker-composepsNameCommandStatePorts---------------------------------------------------------------

linux - PostgreSQL -bash : psql: command not found

我已经安装了PostgreSQL,它工作正常。但是,当我去恢复备份时,我得到了错误-bash:psql:commandnotfound:[root@server1~]#supostgres[postgres@server1root]$psql-fall.sqlbash:psql:commandnotfound[postgres@server1root]$我做错了什么? 最佳答案 exportPATH=/usr/pgsql-9.2/bin:$PATH程序可执行文件psql在/usr/pgsql-9.2/bin目录下,该目录默认不包含在

linux - PostgreSQL psql 终端命令

我正在尝试让psql格式化并遵循文档here.现在,每当我对包含大量列的表进行查询时,无论我的屏幕有多大,每一行都会溢出到下一行,并产生一整屏不可读的垃圾。文档(上面的链接)说有一种方法可以很好地对齐列以获得更可读的输出。通常,要启动psql,我只需键入:psql然后按Enter。现在我正在尝试:psql\psetformataligned得到一个错误:couldnotchangedirectoryto"/root"psql:warning:extracommand-lineargument"aligned"ingoredpsql:FATAL:Indentauthenticationf

ruby-on-rails - 使用 heroku rails 时出错,找不到数据库客户端 psql。检查您的 $PATH 并重试

尝试执行需要我执行railsdb的数据库操作我正在执行herokurunrailsdb但我得到了Runningrailsdbattachedtoterminal...启动,运行.7334找不到数据库客户端:psql。检查您的$PATH并重试。我做了:gemupdateheroku但是没有用。仍然出现相同的错误。还有:$herokurunbundleexecrailsdb--accountwork--appdmplanningRunning`bundleexecrailsdb`attachedtoterminal...up,run.1572Couldn'tfinddatabaseclie