pg.ddx.io pgsql-admin@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: Scott Marlowe <smarlowe@g2switchworks.com>
To: FBaron@co.belcorp.biz
Cc: Bruno Wolff III <bruno@wolff.to>
Cc: pgsql-admin@postgresql.org
Subject: Re: Reindex from command line linux
Date: Fri, 22 Apr 2005 12:01:45 -0500
Message-ID: <1114189305.13303.62.camel@state.g2switchworks.com> (raw)
In-Reply-To: <OFFEA9DF74.DD39A9C3-ON05256FEB.005A920C-05256FEB.005B41D2@belcorp.biz>
References: <OFFEA9DF74.DD39A9C3-ON05256FEB.005A920C-05256FEB.005B41D2@belcorp.biz>
On Fri, 2005-04-22 at 11:36, FBaron@co.belcorp.biz wrote:
>
>
> thanks Bruno :
> I'm running the command with root
> psql -c "REINDEX DATABASE Clibelcorpco FORCE"
> psql: FATAL: La base de datos "root" no existe en el catalogo del
> sistema.(Traslate : The "root" database doesn´t exsists)
>
> I execute :
>
> psql -d Clibelcorpco -c "REINDEX DATABASE Clibelcorpco FORCE"
> ERROR: REINDEX DATABASE: Can be executed only on the currently open
> database.
>
> what do you think?
If this is a cron job you can either schedule it to be run by the
postgres super user's crontab (su - postgres, crontab -e) OR you can use
su - from root's crontab to run this as the postgres (or other) super
user.
su - postgres -c 'psql dbnamehere -c "reindex database"'
I think I got the quoting right there, not guaranteed though.
Note that you are using upper / lower case mixed. Inside the psql
environment, unquoted identifiers are lower case. However, to psql, the
identifier is used "as is". So, to access the Db1 database, you'd have
to enter it correctly, but need no quotes:
psql Db1 -c 'reindex database'
I recommend just sticking to lower case unless you have a business rule
that makes you use mixed case in identifiers. Life it much simpler that
way.
view thread (7+ messages) latest in thread
Message-ID: <1114189305.13303.62.camel@state.g2switchworks.com> Permalink: ../1114189305.13303.62.camel@state.g2switchworks.com/ Also on: postgresql.org/message-id/1114189305.13303.62.camel@state.g2switchworks.com ·
reply
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Reply to all the recipients from your mail client; the link fills in the headers below: reply via email Some clients, webmail especially, drop In-Reply-To and References from a link, and the reply then starts a new thread: use the mbox below. To: pgsql-admin@postgresql.org Cc: smarlowe@g2switchworks.com, FBaron@co.belcorp.biz, bruno@wolff.to Subject: Re: Reindex from command line linux In-Reply-To: <1114189305.13303.62.camel@state.g2switchworks.com> References: <OFFEA9DF74.DD39A9C3-ON05256FEB.005A920C-05256FEB.005B41D2@belcorp.biz> <1114189305.13303.62.camel@state.g2switchworks.com> * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox