Re: [GENERAL] Execute commands in single-user mode

2016-01-18 Thread Jim Nasby
On 1/10/16 3:44 PM, Andreas Joseph Krogh wrote: It might be about time to come up with an extension that's a replacement for large objects. What would it take to fund such an extension? Time and/or money. It would "have to" support: - Migrate existing LOs away from pg_largeobject -

[GENERAL] Execute commands in single-user mode

2016-01-10 Thread Andreas Joseph Krogh
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

Re: [GENERAL] Execute commands in single-user mode

2016-01-10 Thread Andreas Joseph Krogh
På søndag 10. januar 2016 kl. 16:40:23, skrev Tom Lane >: Andreas Joseph Krogh writes: > 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

Re: [GENERAL] Execute commands in single-user mode

2016-01-10 Thread Melvin Davidson
Well, you can't combine psql with the postgres startup, but you can issue subsequent commands from bash with the -c option: EG: postgres --single -O -D $PGDATA $DB_NAME # give postgres a few seconds to complete startup sleep 30 psql -U postgres -d your_database -c "alter table pg_largeobject set

Re: [GENERAL] Execute commands in single-user mode

2016-01-10 Thread Melvin Davidson
Sorry, I've never used single user mode, but here is a better example #!/bin/bash echo "**CHANGING TABLESPACES**" gosu postgres postgres --single -O -D $PGDATA $DB_NAME<<- EOSQL alter table pg_largeobject set tablespace some_tablespace; EOSQL pg_ctl stop -d $PGDATA -m fast echo "" echo

Re: [GENERAL] Execute commands in single-user mode

2016-01-10 Thread Tom Lane
Andreas Joseph Krogh writes: > 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

Re: [GENERAL] Execute commands in single-user mode

2016-01-10 Thread Andreas Joseph Krogh
På søndag 10. januar 2016 kl. 15:52:12, skrev Melvin Davidson < melvin6...@gmail.com >: Well, you can't combine psql with the postgres startup, but you can issue subsequent commands from bash with the -c option:   EG: postgres --single -O -D $PGDATA $DB_NAME #

Re: [GENERAL] Execute commands in single-user mode

2016-01-10 Thread Tom Lane
Andreas Joseph Krogh writes: > På søndag 10. januar 2016 kl. 16:40:23, skrev Tom Lane >: > Andreas Joseph Krogh writes: >>> Then I have to execute the command: >>> alter table pg_largeobject set

Re: [GENERAL] Execute commands in single-user mode

2016-01-10 Thread Andreas Joseph Krogh
På søndag 10. januar 2016 kl. 16:53:54, skrev Tom Lane >: Andreas Joseph Krogh writes: > P�� s��ndag 10. januar 2016 kl. 16:40:23, skrev Tom Lane >: > Andreas Joseph Krogh

Re: [GENERAL] Execute commands in single-user mode

2016-01-10 Thread Jim Nasby
On 1/10/16 10:01 AM, Andreas Joseph Krogh wrote: pg_largeobject being a system-relation does quite make sense to me, but that's another discussion. I know there has been some discussions in the past about making it a non system-relation but it never got anywhere AFAIK. BTW, there's some other

Re: [GENERAL] Execute commands in single-user mode

2016-01-10 Thread Andreas Joseph Krogh
På søndag 10. januar 2016 kl. 22:38:05, skrev Jim Nasby < jim.na...@bluetreble.com >: On 1/10/16 10:01 AM, Andreas Joseph Krogh wrote: > pg_largeobject being a system-relation does quite make sense to me, but > that's another discussion. I know there has been