postgresql - "postgres"Unix 用户的用途

标签 postgresql

<分区>

要访问 psql,我必须先登录到另一个 Unix 帐户

sudo su - postgres

那我可以做

postgres@linux ~ $ psql
psql (9.1.10)
Type "help" for help.

postgres=#

但是,我不明白为什么需要 postgres Unix 帐户(当我执行 sudo su - postgres 时)。仅从我原来的 Unix 帐户运行“psql”有什么问题?

postgres Unix 和命令行是否共享相同的密码?

*我是 Linux/postgres 的新手,所以请随意给出基本解释

编辑:另一个问题: 有什么区别

postgres=#

postgres-#

最佳答案

However, I don't understand why the postgres Unix account (when I do sudo su - postgres) is necessary. What's wrong with just running "psql" from my original Unix account?

And do the postgres Unix and command line share the same password?

Postgres 用户无法登录,只能读取/写入它拥有的任何内容,除非您创建它或以其他方式配置您的计算机。

这就是它存在的原因:安全性。这不是技术上的要求(例如,OSX 上的自制软件将使用您自己的用户名),而是最佳实践——尤其是在服务器上。

关于postgresql - "postgres"Unix 用户的用途,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19870040/

相关文章:

php - 在 lat,lng 范围内查询

mysql - 设计您自己的 MySQL 或 PostgreSQL 连接?

postgresql - 将 Postgresql 8.4 迁移到 9.1

postgresql - postgres double

sql - 将列添加到表并立即将数据添加到 PostgreSQL 中的列

java - 环境变量 DHIS2_HOME : null (TrayApp. java [main])

spring - Bluemix Docker Container部署结果为 “No route to host”

sql - Postgres JSON 数组带有连接?

python - 如何在 SQLAlchemy 的 ExcludeConstraint 中使用 CAST?

php - 将查询结果放入对象