Customising pg directories

Started by Ben Carberyalmost 14 years ago3 messagesgeneral
Jump to latest
#1Ben Carbery
ben.carbery@gmail.com

I am building a new server with a separate partition for data and
xlogs. What is the correct way to do this?

Can I create a symlink from /var/lib/pgsql/9.1/data -> /pg_data (and
then a symlink in /pgdata for xlogs-> /pg_xlog)
Or do I have to modify $PGDATA in the init script?

This is all after installing packages but prior to 'service
postgresql-91 initdb'

cheers

#2Raghavendra
raghavendra.rao@enterprisedb.com
In reply to: Ben Carbery (#1)
Re: Customising pg directories

On Thu, Jun 28, 2012 at 1:20 PM, Ben Carbery <ben.carbery@gmail.com> wrote:

I am building a new server with a separate partition for data and
xlogs. What is the correct way to do this?

Can I create a symlink from /var/lib/pgsql/9.1/data -> /pg_data (and
then a symlink in /pgdata for xlogs-> /pg_xlog)
Or do I have to modify $PGDATA in the init script?

This is all after installing packages but prior to 'service
postgresql-91 initdb'

cheers

initdb --pgdata <datadirectory> --xlogdir <pg_xlog location>, is the
command which suit's your requirement.

This command will take care of creating symblinks as well.

---
Regards,
Raghavendra
EnterpriseDB Corporation
Blog: http://raghavt.blogspot.com/

#3Raghavendra
raghavendra.rao@enterprisedb.com
In reply to: Ben Carbery (#1)
Re: Customising pg directories

Thanks too... :)

--Raghav

On Thu, Jun 28, 2012 at 4:52 PM, Ben Carbery <ben.carbery@gmail.com> wrote:

Show quoted text

Too easy, thanks.

On 28 June 2012 18:38, Raghavendra <raghavendra.rao@enterprisedb.com>
wrote:

On Thu, Jun 28, 2012 at 1:20 PM, Ben Carbery <ben.carbery@gmail.com>

wrote:

I am building a new server with a separate partition for data and
xlogs. What is the correct way to do this?

Can I create a symlink from /var/lib/pgsql/9.1/data -> /pg_data (and
then a symlink in /pgdata for xlogs-> /pg_xlog)
Or do I have to modify $PGDATA in the init script?

This is all after installing packages but prior to 'service
postgresql-91 initdb'

cheers

initdb --pgdata <datadirectory> --xlogdir <pg_xlog location>, is the

command

which suit's your requirement.

This command will take care of creating symblinks as well.

---
Regards,
Raghavendra
EnterpriseDB Corporation
Blog: http://raghavt.blogspot.com/