Questions tagged «postgresql-9.1»

PostgreSQL 9.1版

3
复制失败;如何继续下去?
我在Ubuntu上运行Postgres 9.1.6,并且在主服务器和从服务器之间设置了流复制设置。一切都运行顺利,直到数据库崩溃为止,我们不得不重新启动这两个盒子。 现在,复制已停止,并且当检查两个框中的日志时,我看到以下消息: CDT FATAL:请求的WAL段0000000100000224000000FA已被删除 一遍又一遍是同一段。从我的Google搜索中,似乎复制服务器正在尝试从主服务器检索此段,但是现在不再存在。好的,但是如何解决这个问题?我是否需要进行新的备份并将其重新同步到从站?有没有一种简单的方法可以使从站恢复同步?

1
对值为NULL的布尔值进行查询时发生意外的Seq扫描
我有一个称为auto_review列类型为的数据库列boolean。使用ActiveRecord ORM创建该字段的索引。 CREATE INDEX index_table_on_auto_renew ON table USING btree (auto_renew); 当我在字段中查询布尔值时,PG会按预期使用索引。 EXPLAIN for: SELECT "table".* FROM "table" WHERE "table"."auto_renew" = 'f' QUERY PLAN ---------------------------------------------------------------------------------------------- Bitmap Heap Scan on table (cost=51.65..826.50 rows=28039 width=186) Filter: (NOT auto_renew) -> Bitmap Index Scan on index_domains_on_auto_renew (cost=0.00..44.64 rows=2185 width=0) Index Cond: (auto_renew = false) (4 …

3
是否实际使用了关键字“ ALIAS”?
根据PostgreSQL 7.1到9.1(目前不支持),ALIAS至少在SQL-99中被列为保留字。更高版本未显示它-表示已将其作为保留字删除。旧的PostgreSQL文档确实说过“关键字的存在并不表示功能的存在。” 给表或列加别名时我见过AS,但从没见过ALIAS。 SQL关键字在哪里(或曾经在哪里)ALIAS?它是曾经使用过还是仅保留供将来使用?

1
如何在PostgreSQL中从本地文件复制到远程数据库?[关闭]
已关闭。这个问题需要细节或说明。它当前不接受答案。 想改善这个问题吗?添加细节并通过编辑此帖子来澄清问题。 6年前关闭。 我是psql的新手,需要一些帮助。如何将本地CSV加载到远程数据库? 我正在使用以下命令 \COPY test(user_id, product_id, value) FROM '/Users/testuser/test.tsv' WITH DELIMITER '\t' CSV HEADER; 但这会在远程数据库上搜索文件,而我需要在本地PC上进行搜索。

4
PostgreSQL:更改用户密码无效
我安装PostgreSQL在EC2计算机上,现在我想更改用户密码postgres 我做 $ sudo -u postgres psql psql (9.1.5) Type "help" for help. postgres=# ALTER USER postgres WITH PASSWORD 'newpasswd'; ALTER ROLE 然后我退出外壳并尝试使用新密码登录 $ psql -U postgres -W Password for user postgres: psql: FATAL: Peer authentication failed for user "postgres" 我的PostgreSQL版本是 $ psql --version psql (PostgreSQL) 9.1.5 contains support for …


1
Postgres 9.1.6错误索引在块0包含意外的零页
我在运行于debian服务器上的Postgres 9.1.6上设置了流复制,并且一切正常。 当我尝试在副本数据库上运行查询时,出现以下错误: ERROR: index "tbl_cust_id_idx" contains unexpected zero page at block 0 HINT: Please REINDEX it. 是什么导致此错误? 该问题也发布在/programming/17865135/postgres-9-1-6-error-index-contains-unexpected-zero-page-at-block-0

3
如何将带有数组字段的表类型传递给Postgresql中的函数
我有一张桌子叫书 CREATE TABLE book ( id smallint NOT NULL DEFAULT 0, bname text, btype text, bprices numeric(11,2)[], CONSTRAINT key PRIMARY KEY (id ) ) 和一个功能save_book CREATE OR REPLACE FUNCTION save_book(thebook book) RETURNS text AS $BODY$ DECLARE myoutput text :='Nothing has occured'; BEGIN update book set bname=thebook.bname, btype=thebook.btype,bprices=thebook.bprices WHERE id=thebook.id; IF …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.