Skip site navigation (1) Skip section navigation (2)

Re: how to REINDEX pg_database on

From: Joshua Daniel Franklin <joshuadfranklin(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: how to REINDEX pg_database on
Date: 2009-07-20 17:50:02
Message-ID: cb51e2e0907201050l77e557c3k9cdc5f7d37b90e7e@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-admin
On Mon, Jul 20, 2009 at 8:39 AM, Alvaro Herrera wrote:
> Joshua Daniel Franklin escribió:
>> > postgres -P -D /usr/local/databases/pgsql/data pg_database
>> > FATAL:  database "pg_database" does not exist
>>
>> So... does that 'FATAL:  database "pg_database" does not exist' message
>> mean it's game over ?
>
> No, it means you didn't pass the correct parameters.  You need to pass
> the database name, not "pg_database".

I don't understand how to do this. I've read the manual at
http://www.postgresql.org/docs/7.4/interactive/sql-reindex.html
It mentions that "standalone server must be used to repair" system catalogs,
but doesn't give any special instructions to do so.

I tried REINDEX for various databases and it says it's doing something,
but when I try to list the databases or pg_dumpall it says it is empty.
However, as I mentioned earlier if I run a specific SELECT on any of my
user tables I see the data.


$ postgres -P -D /usr/local/databases/pgsql/data template0
backend> reindex database template0;
NOTICE:  table "pg_class" was reindexed
NOTICE:  table "pg_constraint" was reindexed
NOTICE:  table "pg_description" was reindexed
NOTICE:  table "pg_proc" was reindexed
NOTICE:  table "pg_rewrite" was reindexed
NOTICE:  table "pg_statistic" was reindexed
NOTICE:  table "pg_shadow" was reindexed
NOTICE:  table "pg_attrdef" was reindexed
NOTICE:  table "pg_type" was reindexed
NOTICE:  table "pg_attribute" was reindexed
NOTICE:  table "pg_index" was reindexed
NOTICE:  table "pg_operator" was reindexed
NOTICE:  table "pg_opclass" was reindexed
NOTICE:  table "pg_am" was reindexed
NOTICE:  table "pg_amop" was reindexed
NOTICE:  table "pg_amproc" was reindexed
NOTICE:  table "pg_language" was reindexed
NOTICE:  table "pg_aggregate" was reindexed
NOTICE:  table "pg_trigger" was reindexed
NOTICE:  table "pg_cast" was reindexed
NOTICE:  table "pg_namespace" was reindexed
NOTICE:  table "pg_conversion" was reindexed
NOTICE:  table "pg_depend" was reindexed
NOTICE:  table "pg_database" was reindexed
NOTICE:  table "pg_group" was reindexed
NOTICE:  table "pg_inherits" was reindexed
NOTICE:  table "pg_largeobject" was reindexed

....
xbrain_queries=# \d
No relations found.
xbrain_queries=# \l
   List of databases
 Name | Owner | Encoding
------+-------+----------
(0 rows)

In response to

Responses

pgsql-admin by date

Next:From: Alvaro HerreraDate: 2009-07-20 18:00:04
Subject: Re: how to REINDEX pg_database on
Previous:From: Alvaro HerreraDate: 2009-07-20 15:39:19
Subject: Re: how to REINDEX pg_database on

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group