starting postgres with several Data directories
Hello, pgsql guru
I have windows version of postgres 8.4 for experiments.
At first - what I have done so far:
1. Copied content of Data directory to Data2
2. Changed the port to 5433 in Data2\postgresql.conf
3. Started postgres from commant prompt like (F:/Program
Files/PostgreSQL/8.4/bin/pg_ctl.exe start -N "postgresql-8.42" -D
"F:/Program Files/PostgreSQL/8.4/data2" -w)
4. Started service of postgres (witch uses Data directory).
5. Test the connection with PgAdmin. Connection OK. Inserting into table of
one server instance doesn't effect second one. Everything seems to work OK.
I wanted to ask if it is OK to start several instances of postgres pointing
to different data directories? I guess thats what the data directories are
after all, but because I failed to find some assurance while google'ing I'm
asking the question. It would be a crying shame to ruin production DB
because of experimental stuff. :)
Thank you in advance.
Julius Tuskenis
--
Sent via pgsql-admin mailing list (pgsql-admin [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Re: starting postgres with several Data directories
On Mon, Dec 21, 2009 at 1:46 PM, Julius T <julius [at] nsoft.lt> wrote:
> Hello, pgsql guru
>
> I have windows version of postgres 8.4 for experiments.
> At first - what I have done so far:
> 1. Copied content of Data directory to Data2
> 2. Changed the port to 5433 in Data2\postgresql.conf
> 3. Started postgres from commant prompt like (F:/Program
> Files/PostgreSQL/8.4/bin/pg_ctl.exe start -N "postgresql-8.42" -D
> "F:/Program Files/PostgreSQL/8.4/data2" -w)
> 4. Started service of postgres (witch uses Data directory).
> 5. Test the connection with PgAdmin. Connection OK. Inserting into table of
> one server instance doesn't effect second one. Everything seems to work OK.
>
> I wanted to ask if it is OK to start several instances of postgres pointing
> to different data directories? I guess thats what the data directories are
> after all, but because I failed to find some assurance while google'ing I'm
> asking the question. It would be a crying shame to ruin production DB
> because of experimental stuff. :)
Yes, it's fine. Make a different data dir, point the postgresql.conf
gile to a different tcp port and off ya go. I do it all the time to
test slony setup at work.
--
Sent via pgsql-admin mailing list (pgsql-admin [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Re: starting postgres with several Data directories
--0016e6d99a2142fd02047b43be45
Content-Type: text/plain; charset=ISO-8859-1
On Mon, Dec 21, 2009 at 4:17 PM, Scott Marlowe <scott.marlowe [at] gmail.com>wrote:
>
>
> Yes, it's fine. Make a different data dir, point the postgresql.conf
> gile to a different tcp port and off ya go. I do it all the time to
> test slony setup at work.
>
Agreed, I've actually used it for a couple of different reasons, including
production in a couple of different architectures, no worries about it,
other than making sure you have enough memory on the box to support them
all, along with the remembering which instance you're logged into at a given
time :)
--Scott
--0016e6d99a2142fd02047b43be45
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<br><div class=3D"gmail_quote">On Mon, Dec 21, 2009 at 4:17 PM, Scott Marlo=
we <span dir=3D"ltr"><<a href=3D"mailto:scott.marlowe [at] gmail.com">scott.m=
arlowe [at] gmail.com</a>></span> wrote:<br><blockquote class=3D"gmail_quote"=
style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class=3D"im"><br>
<br>
</div>Yes, it's fine. =A0Make a different data dir, point the postgresq=
l.conf<br>
gile to a different tcp port and off ya go. =A0I do it all the time to<br>
test slony setup at work.<br></blockquote><div><br></div><div>Agreed, I'=
;ve actually used it for a couple of different reasons, including productio=
n in a couple of different architectures, no worries about it, other than m=
aking sure you have enough memory on the box to support them all, along wit=
h the remembering which instance you're logged into at a given time :)<=
/div>
<div><br></div><div>--Scott</div></div>
--0016e6d99a2142fd02047b43be45--
Re: starting postgres with several Data directories
On Mon, Dec 21, 2009 at 2:26 PM, Scott Mead
<scott.lists [at] enterprisedb.com> wrote:
>
> On Mon, Dec 21, 2009 at 4:17 PM, Scott Marlowe <scott.marlowe [at] gmail.com>
> wrote:
>>
>>
>> Yes, it's fine. =A0Make a different data dir, point the postgresql.conf
>> gile to a different tcp port and off ya go. =A0I do it all the time to
>> test slony setup at work.
>
> Agreed, I've actually used it for a couple of different reasons, including
> production in a couple of different architectures, no worries about it,
> other than making sure you have enough memory on the box to support them
> all, along with the remembering which instance you're logged into at a gi=
ven
> time :)
Yeah, I create a different "admin" account for each one, that has the
PGPORT and stuff already set, and setup pg_hba.conf to reject the
admin accounts from other instances so I don't do anything too stupid.
--
Sent via pgsql-admin mailing list (pgsql-admin [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Re: starting postgres with several Data directories
--0016e6d58cb2303b1d047b44069b
Content-Type: text/plain; charset=ISO-8859-1
On Mon, Dec 21, 2009 at 4:35 PM, Scott Marlowe <scott.marlowe [at] gmail.com>wrote:
> On Mon, Dec 21, 2009 at 2:26 PM, Scott Mead
> <scott.lists [at] enterprisedb.com> wrote:
> >
> > On Mon, Dec 21, 2009 at 4:17 PM, Scott Marlowe <scott.marlowe [at] gmail.com>
> > wrote:
> >>
>
>
> Yeah, I create a different "admin" account for each one, that has the
> PGPORT and stuff already set, and setup pg_hba.conf to reject the
> admin accounts from other instances so I don't do anything too stupid.
>
The other useful trick is to change set your psql prompt (via .psqlrc) so
that it shows which port the db you're logged into is listening on:
\set PROMPT1 '%/:%>=%# '
This will give you a prompt of:
postgres:5432=#
Take a look at http://www.postgresql.org/docs/8.3/static/app-psql.html for
more prompt options.
--Scott
--0016e6d58cb2303b1d047b44069b
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
On Mon, Dec 21, 2009 at 4:35 PM, Scott Marlowe <span dir=3D"ltr"><<a hre=
f=3D"mailto:scott.marlowe [at] gmail.com">scott.marlowe [at] gmail.com</a>></span>=
wrote:<div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class=3D"h5">On Mon, Dec 21, 2009 at 2:26 PM, Scott Me=
ad<br>
<<a href=3D"mailto:scott.lists [at] enterprisedb.com">scott.lists [at] enterprised=
b.com</a>> wrote:<br>
><br>
> On Mon, Dec 21, 2009 at 4:17 PM, Scott Marlowe <<a href=3D"mailto:s=
cott.marlowe [at] gmail.com">scott.marlowe [at] gmail.com</a>><br>
> wrote:<br>
>><br><br>
<br>
</div></div>Yeah, I create a different "admin" account for each o=
ne, that has the<br>
PGPORT and stuff already set, and setup pg_hba.conf to reject the<br>
admin accounts from other instances so I don't do anything too stupid.<=
br></blockquote><div><br></div><div>The other useful trick is to change set=
your psql prompt (via .psqlrc) so that it shows which port the db you'=
re logged into is listening on:</div>
<div><br></div><div>\set PROMPT1 '%/:%>=3D%# '</div><div><br></d=
iv><div>This will give you a prompt of:</div><div><br></div><div>postgres:5=
432=3D#</div><div><br></div><div>Take a look at=A0<a href=3D"http://www.pos=
tgresql.org/docs/8.3/static/app-psql.html">http://www.postgr esql.org/docs/8=
..3/static/app-psql.html</a> for more prompt options.</div>
<div><br></div><div><br></div><div>--Scott</div><div><br></div></div><br>
--0016e6d58cb2303b1d047b44069b--
Re: starting postgres with several Data directories
Thank you, Scott & Scott :)
I appreciate your help.
--
Julius Tuskenis
Programavimo skyriaus vadovas
UAB nSoft
mob. +37068233050
--
Sent via pgsql-admin mailing list (pgsql-admin [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin