Обсуждение: Alternate Database Locations

Поиск
Список
Период
Сортировка

Alternate Database Locations

От
"Brian C. Doyle"
Дата:
Hello,

I am working on seting up alternate database locations for my users.
I have done

% initlocation /home/userid
% createdb -D /home/userid userid

and i always get

ERROR:  The database path '/home/httpd/jbbent' is invalid. This may be due 
to a character that is not allowed or because the chosen path isn't 
permitted for databases

I have done both of these as the user and as postgres I have had the dir 
chmod to 777 and still nothing.  what am I doing wrong?




Re: Alternate Database Locations

От
"Brian C. Doyle"
Дата:
Never mind... I got it working

At 02:40 PM 10/24/00 -0400, Brian C. Doyle wrote:
>Hello,
>
>I am working on seting up alternate database locations for my users.
>I have done
>
>% initlocation /home/userid
>% createdb -D /home/userid userid
>
>and i always get
>
>ERROR:  The database path '/home/httpd/jbbent' is invalid. This may be due 
>to a character that is not allowed or because the chosen path isn't 
>permitted for databases
>
>I have done both of these as the user and as postgres I have had the dir 
>chmod to 777 and still nothing.  what am I doing wrong?
>



Re: Alternate Database Locations

От
"Brian C. Doyle"
Дата:
Well I got it working kinda.

You have set up an environment for the new directory and export it under 
the PGSQL super user account

PGDATA2=/home/userid
export PGDATA2

Then run
initlocation PGDATA2

After that you have to restart your postmaster with the data dir as PGDATA2
postmaster -d PGDATA2

Now you can greate a new db in a new location
createdb mydb -D PGDATA2

that is it and you have a new location for ALL your database if you use it 
... If you do not add -D PGDATA2 for future db it writes to the default 
location but you may have problems access it.

I am still trying to find out how to get multiple postmasters running on 
different ports at the same time.  Does anyone have any clue how to do that?


At 12:04 PM 10/25/00 -0700, Roderick A. Anderson wrote:
>On Tue, 24 Oct 2000, Brian C. Doyle wrote:
>
> > Never mind... I got it working
>
>OK, don't play your cards so close to the vest.  What was the problem (and
>solution)?
>
>
>TIA,
>Rod
>--
>Roderick A. Anderson
>raanders@altoplanos.net               Altoplanos Information Systems, Inc.
>Voice: 208.765.6149                            212 S. 11th Street, Suite 5
>FAX: 208.664.5299                                  Coeur d'Alene, ID 83814



Re: Alternate Database Locations

От
"Roderick A. Anderson"
Дата:
On Tue, 24 Oct 2000, Brian C. Doyle wrote:

> Never mind... I got it working

OK, don't play your cards so close to the vest.  What was the problem (and
solution)?


TIA,
Rod
--
Roderick A. Anderson
raanders@altoplanos.net               Altoplanos Information Systems, Inc.
Voice: 208.765.6149                            212 S. 11th Street, Suite 5
FAX: 208.664.5299                                  Coeur d'Alene, ID 83814



Re: Alternate Database Locations

От
Tom Lane
Дата:
"Brian C. Doyle" <bcdoyle@mindspring.com> writes:
> I am still trying to find out how to get multiple postmasters running on 
> different ports at the same time.  Does anyone have any clue how to do that?

Uh, you just do it.  Start each postmaster in a different data directory
and with a different port number (-D and -P switches) and you're set.

Unless you run out of shared memory or some such, in which case some
tweaking of kernel parameters is called for...
        regards, tom lane


plperl

От
Jie Liang
Дата:
hi,

I followed README tried to install plperl:

su-2.04# cd /work/src/pgsql702/src/pl/plperl
su-2.04# perl Makefile.PL
Writing Makefile for plperl
su-2.04# make
"../../../src/Makefile.global", line 135: Need an operator
"../../../src/Makefile.global", line 139: Missing dependency operator
"../../../src/Makefile.global", line 143: Need an operator
"../../../src/Makefile.global", line 144: Missing dependency operator
"../../../src/Makefile.global", line 148: Need an operator
"../../../src/Makefile.global", line 149: Need an operator
"../../../src/Makefile.global", line 150: Need an operator
"../../../src/Makefile.port", line 1: Need an operator
"../../../src/Makefile.port", line 3: Need an operator
"../../../src/Makefile.port", line 6: Need an operator
"../../../src/Makefile.port", line 8: Need an operator
"../../../src/Makefile.port", line 16: Need an operator
"../../../src/Makefile.global", line 246: Missing dependency operator
"../../../src/Makefile.global", line 247: Could not find
../../../src/Makefile.custom
"../../../src/Makefile.global", line 248: Need an operator
"../../../src/Makefile.global", line 253: Missing dependency operator
"../../../src/Makefile.global", line 255: Need an operator
"../../../src/Makefile.global", line 284: Missing dependency operator
"../../../src/Makefile.global", line 286: Need an operator
"../../../src/Makefile.global", line 288: Missing dependency operator
"../../../src/Makefile.global", line 290: Need an operator
"../../../src/Makefile.global", line 292: Missing dependency operator
"../../../src/Makefile.global", line 294: Need an operator
"../../../src/Makefile.global", line 296: Need an operator
"../../../src/Makefile.global", line 299: Need an operator
"../../../src/Makefile.global", line 301: Need an operator
"../../../src/Makefile.global", line 304: Need an operator
make: fatal errors encountered -- cannot continue
su-2.04#

what I need to do?

--
Jie LIANG

Internet Products Inc.

10350 Science Center Drive
Suite 100, San Diego, CA 92121
Office:(858)320-4873

jliang@ipinc.com
www.ipinc.com





Re: Alternate Database Locations

От
indraneel@www.cdfd.org.in
Дата:
AFAIK the port number is compiled in, so you need to recompile. It's there
in the docs somewhere. you have to use a different value for --with-pgport
option in ./configure .

On Wed, 25 Oct 2000, Brian C. Doyle wrote:

> 
> I am still trying to find out how to get multiple postmasters running on 
> different ports at the same time.  Does anyone have any clue how to do that?
> 



Re: plperl

От
Tom Lane
Дата:
Jie Liang <jliang@ipinc.com> writes:
> su-2.04# make
> "../../../src/Makefile.global", line 135: Need an operator
> "../../../src/Makefile.global", line 139: Missing dependency operator

Hmm, is "make" on your machine GNU make?  If not try "gmake".
        regards, tom lane


Re: Alternate Database Locations

От
"Brian C. Doyle"
Дата:
Okay I am still doing something wrong here

I set PGDATA2=/home/user1/database
export PGDATA2

then I start postmaster
postmaster -d PGDATA2 -i -p  5431 &
and i get

Can't create pid file: /usr/local/pgsql/data/postmaster.pid
Is another postmaster (pid: 10686) running?

What am I missing... I know it must be simple!!!

Thanks for all of your help!


At 10:43 PM 10/25/00 -0400, Tom Lane wrote:
>"Brian C. Doyle" <bcdoyle@mindspring.com> writes:
> > I am still trying to find out how to get multiple postmasters running on
> > different ports at the same time.  Does anyone have any clue how to do 
> that?
>
>Uh, you just do it.  Start each postmaster in a different data directory
>and with a different port number (-D and -P switches) and you're set.
>
>Unless you run out of shared memory or some such, in which case some
>tweaking of kernel parameters is called for...
>
>                         regards, tom lane



Re: Alternate Database Locations

От
Tom Lane
Дата:
"Brian C. Doyle" <bcdoyle@mindspring.com> writes:
> Okay I am still doing something wrong here
> I set PGDATA2=/home/user1/database
> export PGDATA2

> then I start postmaster
> postmaster -d PGDATA2 -i -p  5431 &

I think you are confusing the "alternate database directory" stuff with
having a separate installation (primary directory).  To set up a second
postmaster, you first have to initdb its installation directory:
initdb -D /home/user1/database

then start the postmaster like so:
postmaster -D /home/user1/database -p whatever ...

Instead of -D (note upper case), you can alternatively set env variable
PGDATA for these two programs.

The stuff in the manual about alternate database directories is to allow
a *single* postmaster to manage databases located somewhere other than
underneath its installation directory.  It's got nothing at all to do
with starting additional postmasters.
        regards, tom lane


Re: Alternate Database Locations

От
Tom Lane
Дата:
"Brian C. Doyle" <bcdoyle@mindspring.com> writes:
> createdb user1 -D 'PGDATA2'
> it creates but it is putting it in /home/user/database
> the first alt location i set up!!!

Um, are you sure createdb is connecting to the right postmaster?
When you use multiple postmasters you have to keep a close eye
on clients' PGPORT settings ...

If it is the right postmaster but wrong interpretation of PGDATA2,
the odds are that you started that postmaster with the wrong value
of PGDATA2.  Remember that it's the postmaster's environment, not
the client's, in which alternate-DB environment variables are expanded.
(initlocation is an exception because it doesn't contact the postmaster)
        regards, tom lane


Re: plperl

От
Peter Eisentraut
Дата:
Jie Liang writes:

> "../../../src/Makefile.global", line 304: Need an operator
> make: fatal errors encountered -- cannot continue
> su-2.04#
> 
> what I need to do?

Use GNU make.

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/



Re: Alternate Database Locations

От
"Brian C. Doyle"
Дата:
Okay...

I can now run as many postmasters as I could imagine... KICK BUTT!!!!

I am still running into a problem with the "alternate database 
locations"  and that is  I seem to be able to only set up 1 other alternate 
location.

After getting the first alt location setup Iset PGDATA2= /home/user1/database
export it
initdb -D /home/user1/database
started postmaster -D /home/user1/database initlocation 'PGDATA2'
createdb user1 -D 'PGDATA2'
it creates but it is putting it in /home/user/database
the first alt location i set up!!!

I know I am being a pain in the ass but I truly do appreciate all the help

 At 10:02 AM 10/26/00 -0400, Tom Lane wrote:
>"Brian C. Doyle" <bcdoyle@mindspring.com> writes:
> > Okay I am still doing something wrong here
> > I set PGDATA2=/home/user1/database
> > export PGDATA2
>
> > then I start postmaster
> > postmaster -d PGDATA2 -i -p  5431 &
>
>I think you are confusing the "alternate database directory" stuff with
>having a separate installation (primary directory).  To set up a second
>postmaster, you first have to initdb its installation directory:
>
>         initdb -D /home/user1/database
>
>then start the postmaster like so:
>
>         postmaster -D /home/user1/database -p whatever ...
>
>Instead of -D (note upper case), you can alternatively set env variable
>PGDATA for these two programs.
>
>The stuff in the manual about alternate database directories is to allow
>a *single* postmaster to manage databases located somewhere other than
>underneath its installation directory.  It's got nothing at all to do
>with starting additional postmasters.
>
>                         regards, tom lane



Re: Alternate Database Locations

От
Peter Eisentraut
Дата:
Brian C. Doyle writes:

> Okay I am still doing something wrong here
> 
> I set PGDATA2=/home/user1/database
> export PGDATA2
> 
> then I start postmaster
> postmaster -d PGDATA2 -i -p  5431 &

postmaster -D $PGDATA -i -p 5431 >logfile 2>&1 </dev/null &

> and i get
> 
> Can't create pid file: /usr/local/pgsql/data/postmaster.pid
> Is another postmaster (pid: 10686) running?

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/



Re: Alternate Database Locations

От
indraneel@www.cdfd.org.in
Дата:
Is that a small d or a capital D? try this:
postmaster -D $PGDATA2 -i -p 5431 &

\Indraneel

On Thu, 26 Oct 2000, Brian C. Doyle wrote:

> Okay I am still doing something wrong here
> 
> I set PGDATA2=/home/user1/database
> export PGDATA2
> 
> then I start postmaster
> postmaster -d PGDATA2 -i -p  5431 &
> and i get
> 
> Can't create pid file: /usr/local/pgsql/data/postmaster.pid
> Is another postmaster (pid: 10686) running?
> 
> What am I missing... I know it must be simple!!!
> 
> Thanks for all of your help!