我在我的电脑上安装了两台 PostgreSQL 服务器。一个是 9.1,另一个是 9.3。我需要安装两台服务器。
但是,当我运行 pg_dump 时,出现版本不匹配错误:
server version: 9.3.6; pg_dump version: 9.1.15
pg_dump: aborting because of server version mismatch
Run Code Online (Sandbox Code Playgroud)
我该如何解决?(无法卸载任一版本 - 我先安装了 9.1,几个月后又安装了 9.3 - 我需要安装两个数据库服务器)。
我正在使用postgres用户执行一些特殊命令。为此,我正在尝试以下操作:
$ sudo su - postgres
postgres$ ls -l /tmp
drwxrwxrwt 13 root root 4096 jun 8 12:20 tmp
Run Code Online (Sandbox Code Playgroud)
PGPASSWORD=mypasswordhere time pg_dump --username=postgres --no-password -f /tmp/myfilehere.sql mydatabasehere
pg_dump: [archiver] could not open output file "/tmp/myfilehere.sql": Permiso denegado
Command exited with non-zero status 1
0.25user 0.06system 0:02.04elapsed 15%CPU (0avgtext+0avgdata 58064maxresident)k
0inputs+0outputs (0major+5110minor)pagefaults 0swaps
Run Code Online (Sandbox Code Playgroud)
问题:为什么我不能/tmp用 user写入postgres?注意粘性标志设置在 上/tmp。