Re: [GENERAL] PGDATA / data_directory

2016-09-07 Thread Christoph Berg
Re: Jehan-Guillaume de Rorthais 2016-09-07 <20160907140816.3e13eaa3@firost>
> Indeed. I never noticed data_directory was set in postgresql.conf file...
> 
> But then, why starting PostgreSQL with the following command ?
> 
>   /usr/lib/postgresql/9.4/bin/postgres -D /var/lib/postgresql/9.4/main \
> -c config_file=/etc/postgresql/9.4/main/postgresql.conf
> 
> It seems the following one work as expected and seems more logical with this
> setup:
> 
>   /usr/lib/postgresql/9.4/bin/postgres -D /etc/postgresql/9.4/main/

TBH, I've been wondering about that myself, but never bothered to to
anything about it. Digging in the (now git) history, it's been like
that from the very beginning in 2005:

https://anonscm.debian.org/cgit/pkg-postgresql/postgresql-common.git/commit/?id=9fa563e78366db3b27d680607c202b6fbb00bef2

It got touched a bit when 8.0 support was added, but basically not
changed since then.

https://anonscm.debian.org/cgit/pkg-postgresql/postgresql-common.git/commit/?id=fecbaad06c3683452228d31c0baffb01ba626a9a

I'll see if I can simply remove it. Thanks for the suggestion.

Christoph


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


Re: [GENERAL] PGDATA / data_directory

2016-09-07 Thread Jehan-Guillaume de Rorthais
On Sun, 4 Sep 2016 11:40:38 +0200
Christoph Berg  wrote:

> Re: Benoit Lobréau 2016-08-31
> 

Re: [GENERAL] PGDATA / data_directory

2016-09-04 Thread Christoph Berg
Re: Benoit Lobréau 2016-08-31 

[GENERAL] PGDATA / data_directory

2016-09-02 Thread Benoit Lobréau
Hi,

My company is using PGDATA to store configuration files and the guc
data_directory to give the path to the instance directory.

They would use it like this:

pg_ctl start -D  -w

with this directory setup:

/CONFDIR => postgresql.conf pg_hba.conf pg_ident.conf
/SYSTEM => All the normal stuff in the postgres instance
directory + recovery.conf recovery.done etc...

Is it commonly used ?

Thanks for your help / remarks / feedback.

Benoit.


[GENERAL] PGDATA

2014-12-17 Thread Adrian Klaver
Just out of curiosity is there a reason PGDATA is not listed with the 
other environment variables here?:


http://www.postgresql.org/docs/9.3/interactive/libpq-envars.html

--
Adrian Klaver
adrian.kla...@aklaver.com


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


Re: [GENERAL] PGDATA

2014-12-17 Thread David G Johnston
Adrian Klaver-4 wrote
 Just out of curiosity is there a reason PGDATA is not listed with the 
 other environment variables here?:
 
 http://www.postgresql.org/docs/9.3/interactive/libpq-envars.html

Yes, because PGDATA is not a client concern and thus is not something that
libpq cares about.

Clients only care about the public interface the server offers - stuff that
is socket related or that aids in identifying itself.

David J.






--
View this message in context: 
http://postgresql.nabble.com/PGDATA-tp5831209p5831210.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


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


Re: [GENERAL] PGDATA

2014-12-17 Thread Michael Paquier
On Thu, Dec 18, 2014 at 10:23 AM, Adrian Klaver
adrian.kla...@aklaver.com wrote:
 Just out of curiosity is there a reason PGDATA is not listed with the other
 environment variables here?:

 http://www.postgresql.org/docs/9.3/interactive/libpq-envars.html
PGDATA is not an environment variables that can be used for
connections with libpq, see for example fe-connect.c.
-- 
Michael


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


Re: [GENERAL] PGDATA

2014-12-17 Thread Adrian Klaver

On 12/17/2014 05:39 PM, Michael Paquier wrote:

On Thu, Dec 18, 2014 at 10:23 AM, Adrian Klaver
adrian.kla...@aklaver.com wrote:

Just out of curiosity is there a reason PGDATA is not listed with the other
environment variables here?:

http://www.postgresql.org/docs/9.3/interactive/libpq-envars.html

PGDATA is not an environment variables that can be used for
connections with libpq, see for example fe-connect.c.



I see. Still it would be nice to have all the environment variables in 
one place.


Are there any more then those listed on the libpq page and PGDATA?

--
Adrian Klaver
adrian.kla...@aklaver.com


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


Re: [GENERAL] PGDATA

2014-12-17 Thread Michael Paquier
On Thu, Dec 18, 2014 at 12:05 PM, Adrian Klaver adrian.kla...@aklaver.com
wrote:

 Are there any more then those listed on the libpq page and PGDATA?

No other PG* I am aware of.
-- 
Michael


Re: [GENERAL] PGDATA

2014-12-17 Thread Tom Lane
Adrian Klaver adrian.kla...@aklaver.com writes:
 On 12/17/2014 05:39 PM, Michael Paquier wrote:
 PGDATA is not an environment variables that can be used for
 connections with libpq, see for example fe-connect.c.

 I see. Still it would be nice to have all the environment variables in 
 one place.
 Are there any more then those listed on the libpq page and PGDATA?

The server doesn't react to libpq's environment variables at all,
so it wouldn't be particularly sensible to list them together.

The ones it does react to are all, I think, listed on the postgres
reference page:
http://www.postgresql.org/docs/9.3/static/app-postgres.html

regards, tom lane


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


Re: [GENERAL] PGDATA

2006-11-27 Thread Jeffrey Webster

On 24 Nov 2006 04:43:02 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:




I just can't understand the use of this PGDATA variable!

-I am on FC3. (pgl 7.4)
-I am installing rpms and then running /etc/init.d/postgresql start
(which is done by default)
-The resulting data directory is in /var/lib/pgsql/data

I now want the data directory to be on
/home3/myreallylargepartition/pgsql/data
so:

-I login as postgres
-I change .bash_profile so that PGDATA points at the new directory
-I restart the server by  doing a /etc/init.d/postgresql restart

Shouldn't any new tables I create be in the new area?!

Thanks.




After you changed PGDATA, and thus, the location of the data files, did you
remember to run initdb first?

This is the usual sequence of events for changing where the data files exist
(as root, or via sudo):

/etc/init.d/postgresql stop
mkdir -p /pgsql/data
chown -R pgsql:pgsql /pgsql/data
su -l pgsql
export PGDATA=/pgsql/data  # Make sure /etc/init.d/postgresql is aware of
this change.
initdb



Starting the database being the last thing you do.


Re: [GENERAL] PGDATA

2006-11-26 Thread Ragnar
On fös, 2006-11-24 at 16:14 -0800, [EMAIL PROTECTED] wrote:
 
 Well.. you are correct!
 After studying the contents of /etc/init.d/postfresql, I put
 PGDATA=/home3/mylargedisk/data in /etc/sysconfig/pgsql/postgresql
 and it now works.
 
 So what the . is this PGDATA!! It must be a trivial concept
 cause nobody else is worried about how it works!!  And How do I get
 each database to be in a different directory?!!

are you looking for:

  CREATE TABLESPACE myts LOCATION '/foo';
  CREATE DATABASE mydb WITH TABLESPACE=myts;

?

gnari



---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [GENERAL] PGDATA

2006-11-25 Thread [EMAIL PROTECTED]


Well.. you are correct!
After studying the contents of /etc/init.d/postfresql, I put
PGDATA=/home3/mylargedisk/data in /etc/sysconfig/pgsql/postgresql
and it now works.

So what the . is this PGDATA!! It must be a trivial concept
cause nobody else is worried about how it works!!  And How do I get
each database to be in a different directory?!!

Thanks.


 Well not really,  I bet /etc/init.d/postgresql is getting its variables from
 /etc/conf.d/postgresql.  you will have to find it there and change it.

 Regards,

 Richard Broersma Jr.

 ---(end of broadcast)---
 TIP 4: Have you searched our list archives?
 
http://archives.postgresql.org/


---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


[GENERAL] PGDATA

2006-11-24 Thread sasan3


I just can't understand the use of this PGDATA variable!

-I am on FC3. (pgl 7.4)
-I am installing rpms and then running /etc/init.d/postgresql start
(which is done by default)
-The resulting data directory is in /var/lib/pgsql/data

I now want the data directory to be on
/home3/myreallylargepartition/pgsql/data
so:

-I login as postgres
-I change .bash_profile so that PGDATA points at the new directory
-I restart the server by  doing a /etc/init.d/postgresql restart

Shouldn't any new tables I create be in the new area?!

Thanks.


---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [GENERAL] PGDATA

2006-11-24 Thread Richard Broersma Jr
 I just can't understand the use of this PGDATA variable!
 
 -I am on FC3. (pgl 7.4)
 -I am installing rpms and then running /etc/init.d/postgresql start
 (which is done by default)
 -The resulting data directory is in /var/lib/pgsql/data
 
 I now want the data directory to be on
 /home3/myreallylargepartition/pgsql/data
 so:
 
 -I login as postgres
 -I change .bash_profile so that PGDATA points at the new directory
 -I restart the server by  doing a /etc/init.d/postgresql restart
 
 Shouldn't any new tables I create be in the new area?!
 

Well not really,  I bet /etc/init.d/postgresql is getting its variables from
/etc/conf.d/postgresql.  you will have to find it there and change it.

Regards,

Richard Broersma Jr.

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org/


[GENERAL] $PGDATA problem

2001-03-21 Thread Christian Marschalek

Should be selv explainable:

postgres@Server:/home/legshot  initdb
initdb: You must identify where the the data for this database
system will reside.  Do this with either a --pgdata invocation
option or a PGDATA environment variable.

postgres@Server:/home/legshot  echo $PGDATA
/mnt/hdb/usr/local/pgsql/data

---

PGDATA is set and still initdb claims about it?
Any help?

Tia and regrads Chris


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])