Re: CLUSTER not in multi-command string?

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Michael Monnerie <michael(dot)monnerie(at)is(dot)it-management(dot)at>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: CLUSTER not in multi-command string?
Date: 2009-04-29 14:24:37
Message-ID: 20090429142437.GA6316@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Michael Monnerie wrote:
> ERROR: CLUSTER cannot be executed from a function or multi-command
> string
>
> I got this error from a script which tried:
> psql -U postgres db1 -c 'cluster ; analyze'
>
> In the docs there's no word that it's not possible, and I wonder why
> this is not allowed. Anybody knows? It's stupid, as I want to cluster
> lots of tables, followed by analyze, and now I have to
> psql -U postgres db1 -c 'cluster'
> psql -U postgres db1 -c 'analyze'

Multi-table cluster (i.e. the one where you don't specify one table to
cluster) cannot be used in a transaction block, function, etc, and the
FM does mention it:

CLUSTER without any parameter reclusters all the
previously-clustered tables in the current database that the calling
user owns, or all such tables if called by a superuser. This form of
CLUSTER cannot be executed inside a transaction block.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message ml@bortal.de 2009-04-29 15:28:20 Copy source and header files... ./config.sh: line 137: stem.c: No such file or directory
Previous Message william pink 2009-04-29 12:36:45 Rather large Postgres directory