问题标签 [postgresql-9.0]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
java - postgresql9.0 中的故障转移
我已经设置了流复制。WAL 接收方和发送方进程正在运行。我已经在 recovery.conf 文件中输入了 trigger_file 的条目。当我触发故障转移时,它正在创建触发文件但没有发生故障转移,备用数据库仍处于恢复模式。它不会更改为生产。
请帮助我如何成功触发故障转移。
bash - 分段错误 11,zcat 管道进入 postgresql 9.0.5 (Lion)
我有一个这样的bash脚本:
但是在 Mac OS X (Lion) 上运行会给我这个错误:
我在 Snow Leopard 上没有这样的错误,并且这个脚本在我的 arch linux 机器上继续运行良好。仅在我升级到 Lion 后,此脚本才因分段错误而失败。
知道可能是什么问题吗?如果没有明显的直接答案,请指出正确的方向来调试此脚本或在 Mac OS X Lion 上找到问题的根源就可以了!:-)
更新
我进一步隔离了这个问题,可能将其归咎于 postgresql 9.0.5。具体来说,当行:
正在执行(我在终端中一一手动运行命令),我从 postgresql 收到“分段错误:11”错误,如下所示:
这是我在 Lion 上使用的 psql 版本:
有什么建议我还能做什么?
mysql - Postgresql设置下一个要写入的ID
我最近将一个数据库从 mysql 迁移到 pgsql 9。
但是现在当我尝试创建一个新对象(在 django admin 中)时,它告诉我我正在尝试使用的 id(从一个开始并且每次尝试都增加)已经被使用。
我猜有一个指针或索引需要设置为最后使用的 id。我对么?
replication - Postgres 9.0 Binary Replication - Can Archive Mode be turned on for Standby Server?
I am setting Postgres 9.0 binary replication & Archive backup.
For Archiving on Master, I have these options: a) Copy archive to it's local backup location b) Copy to a share network location also accessible by Standby c) rsync archive files to Standby Server
Due to hard disk space problem on Master, I give up (a). Since I doesn't want to re-setup the base backup too often, the growth in size for archive is huge over time.
For (b) & (c), with PostgreSQL 9.0 binary replication, I understand that it can give this benefit: If Standby can't keep up with Master, Standby can always recover itself from archive (which is created by Master) by having restore_cmd in recovery.conf. But I don't prefer (b) or (c) due to the network complexity problem. Also, to avoid the problem of Standby goes out of sync with Master, I set *wal_keep_segments* to huge value.
But in order to have a complete backup system, I still need archiving. I would prefer to enable Archive on the Standby server. Is it possible to do this since Standby is in Recovery mode (there is always a recovery.conf file available) ?
postgresql - PostgreSQL 查询缓存 - 意外关闭连接
上面的代码片段第一次生成:
但这是第二次:
这意味着某些缓存查询会导致问题。我们试图改变查询的顺序,但没有帮助。只有简单的查询,比如SELECT 1+8
可能没有缓存的,总是运行良好。
可以使用 psql 和可能的任何其他语言驱动程序(不仅是 PHP)模拟类似的问题。
当我们安装PostgreSQL 查询缓存时,所有的问题都出现了。
是否应该以某种方式配置查询缓存而不是这种方式?
我们的配置文件在这里: http ://pastebin.com/g2dBjba0 – pcqd_hba.conf http://pastebin.com/X9Y3zrjx – pcqd.conf
postgresql - 无法在 Postgres 中删除 GIN 索引
我有一个看起来像这样的表:
表的大小约为 200,000 条记录。
我想摆脱这个字段及其索引,但 Postgres 似乎不想让我这样做。所有记录中所有字段的值都是一个空的tsvector。
当我发出任何一个
或者
这需要几个小时,最终我停止了它。
CPU 或 RAM 看起来都不是特别高。没有其他客户端连接。
postgresql - postgresql 错误 PANIC:找不到有效的检查点记录
当我加载 postgres 服务器(v9.0.1)时,我得到一个阻止它启动的恐慌:
PANIC:找不到有效的检查点记录
我怎样才能解决这个问题?
postgresql - 错误:postgresql 中不存在函数 unnest(integer[])
执行上述查询时,出现如下错误:
我正在使用 PostgreSQL 8.3,并且我已经_int.sql
在我的数据库中安装了该包以进行整数数组操作。
如何解决此错误?
subquery - 相同组合的表子查询内
我想从表中选择具有完全相同属性的组。例如,我的表如下
在此表中,每个facs_run_id
都有不同的 组合fcj_id
,一些在数字之间共享,facs_run_id
而另一些则不是。例如,上面的facs_run_id
1
and2
是相同的,while 3
has sharedfcj_id
但不等于1
and 2
。我想查询:
fcj_id
从一个特定的地方收集所有facs_run_id
- 找到所有
facs_run_id
具有完全相同的fcj_id
组合。
在这里,我想找到所有与组合facs_run_id
相等的,所以它应该返回(或& )。fcj_id
facs_run_id: 1
2
1
2
我可以得到那些缺少的东西fcj_id
,甚至可以找到fcj_id
缺少的东西:
或这个:
但我无法进行返回 IDENTICAL 的查询facs_run_id
。我想这可以被认为是寻找聚合重复项的一种方式,但我不知道该怎么做。任何建议或指针将不胜感激(或者如果这种类型的查询不起作用,则可以使用更好的方法来创建表)。
postgresql - 如何从全文搜索词典中获取单词列表
有没有办法在 PostgreSQL 中使用 SQL 查询字典,以获取该字典中的单词列表?我正在使用 Postgres 9.0。