Search Postgresql Archives

Re: Execute commands in single-user mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andreas Joseph Krogh <andreas@xxxxxxxxxx> writes:
> På søndag 10. januar 2016 kl. 16:40:23, skrev Tom Lane <tgl@xxxxxxxxxxxxx 
> <mailto:tgl@xxxxxxxxxxxxx>>:
> Andreas Joseph Krogh <andreas@xxxxxxxxxx> writes:
>>> Then I have to execute the command:
>>> alter table pg_largeobject set tablespace some_tablespace;

>  Why do you think you need single-user mode for that?

> Because of this?
> ERROR:  permission denied: "pg_largeobject" is a system catalog

What that means is that you need allow_system_table_mods to be set.
It's a postmaster-start-time GUC, but still just a GUC.

So, assuming that you want to use psql to enter your commands,
you'd do something like this:

1. Add allow_system_table_mods=on to postgresql.conf.
2. Restart postmaster.
3. Issue ALTER TABLE commands.
4. Remove allow_system_table_mods setting from postgresql.conf.
5. Restart postmaster.

Prudence would suggest that you also alter pg_hba.conf to prevent
anyone but yourself from connecting to the postmaster while it's
in this state.  But that's optional.

			regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux