Execute commands in single-user mode

From: Andreas Joseph Krogh <andreas(at)visena(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Execute commands in single-user mode
Date: 2016-01-10 13:53:23
Message-ID: VisenaEmail.50.226f94e7c543b8bd.1522bcb3c7c@tc7-visena
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all.
 
I'm planning to move all my pg_largeobject tables to separate tablespaces and
to be able to do that I need to shuddown PG and start in single-user mode, like
this:
 
postgres --single -O -D $PGDATA $DB_NAME
 
Then I have to execute the command:
alter table pg_largeobject set tablespace some_tablespace;
 
Is it possible to issue the above ALTER-statement from the command-line so I
can start PG in single-user mode AND execute the ALTER-statement from the
command-line i a bash-loop?
 
Thanks.
 
-- Andreas Joseph Krogh
CTO / Partner - Visena AS
Mobile: +47 909 56 963
andreas(at)visena(dot)com <mailto:andreas(at)visena(dot)com>
www.visena.com <https://www.visena.com>
<https://www.visena.com>

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Melvin Davidson 2016-01-10 14:52:12 Re: Execute commands in single-user mode
Previous Message Gavin Flower 2016-01-10 11:19:45 Re: Code of Conduct: Is it time?