Re: pg_config/share_dir

Lists: pgsql-hackers
From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: pg_config/share_dir
Date: 2005-09-07 21:34:13
Message-ID: 431F5CD5.40804@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


pg_config doesn't currently seem to have an option to report the
share_dir. Should it?

cheers

andrew


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_config/share_dir
Date: 2005-09-07 22:46:33
Message-ID: 200509080046.34181.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Dunstan wrote:
> pg_config doesn't currently seem to have an option to report the
> share_dir. Should it?

Is there a case where a user would need anything from there?

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_config/share_dir
Date: 2005-09-07 22:52:39
Message-ID: 431F6F37.8050308@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut wrote:

>Andrew Dunstan wrote:
>
>
>>pg_config doesn't currently seem to have an option to report the
>>share_dir. Should it?
>>
>>
>
>Is there a case where a user would need anything from there?
>
>
>

Why would they need pkglibdir either? I was asked about this by an
author who wanted to use it to find where to put module config/setup
scripts.

cheers

andrew


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_config/share_dir
Date: 2005-09-07 23:38:08
Message-ID: 200509080138.08599.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Dunstan wrote:
> Why would they need pkglibdir either?

To determine what $libdir resolves to.

> I was asked about this by an
> author who wanted to use it to find where to put module config/setup
> scripts.

Probably not in PostgreSQL's data directory, but his own.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Darcy Buskermolen <darcy(at)wavefire(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_config/share_dir
Date: 2005-09-08 00:06:41
Message-ID: 200509071706.41713.darcy@wavefire.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wednesday 07 September 2005 15:52, Andrew Dunstan wrote:
> Peter Eisentraut wrote:
> >Andrew Dunstan wrote:
> >>pg_config doesn't currently seem to have an option to report the
> >>share_dir. Should it?
> >
> >Is there a case where a user would need anything from there?

the way wo do this in slony is with the following macro:

AC_MSG_CHECKING(for postgresql.conf.sample)
PGSHARE_POSSIBLE_LOCATIONS="${with_pgsharedir} /usr/local/pgsql/share /usr/local/share/postgresql /usr/share/postgresql /usr/local/share/pgsql /usr/share/pgsql /opt/local/pgsql/share /opt/pgsql/share
${PG_BINDIR}/../share
for i in $PGSHARE_POSSIBLE_LOCATIONS; do
if test -s "$i/postgresql.conf.sample" ; then
PG_SHAREDIR=$i/
break;
fi
done

if test -n "$PG_SHAREDIR" ; then
AC_MSG_RESULT(${PG_SHAREDIR}postgresql.conf.sample)
AC_DEFINE(PG_SHAREDIR_VERIFIED,1,[PostgreSQL sharedir])
else
AC_MSG_RESULT(not found)
AC_MSG_ERROR(
postgresql.conf.sample not found! Please specify the sharedir
with --with-pgsharedir=<dir>
)
fi

(where ${PG_BINDIR} is the result of: pg_config --bindir )

>
> Why would they need pkglibdir either? I was asked about this by an
> author who wanted to use it to find where to put module config/setup
> scripts.
>
> cheers
>
> andrew
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq

--
Darcy Buskermolen
Wavefire Technologies Corp.

http://www.wavefire.com
ph: 250.717.0200
fx: 250.763.1759


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Darcy Buskermolen <darcy(at)wavefire(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_config/share_dir
Date: 2005-09-08 00:31:30
Message-ID: 431F8662.30506@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Darcy Buskermolen wrote:

>On Wednesday 07 September 2005 15:52, Andrew Dunstan wrote:
>
>
>>Peter Eisentraut wrote:
>>
>>
>>>Andrew Dunstan wrote:
>>>
>>>
>>>>pg_config doesn't currently seem to have an option to report the
>>>>share_dir. Should it?
>>>>
>>>>
>>>Is there a case where a user would need anything from there?
>>>
>>>
>
>the way wo do this in slony is with the following macro:
>
>AC_MSG_CHECKING(for postgresql.conf.sample)
>PGSHARE_POSSIBLE_LOCATIONS="${with_pgsharedir} /usr/local/pgsql/share /usr/local/share/postgresql /usr/share/postgresql /usr/local/share/pgsql /usr/share/pgsql /opt/local/pgsql/share /opt/pgsql/share
>${PG_BINDIR}/../share
>for i in $PGSHARE_POSSIBLE_LOCATIONS; do
> if test -s "$i/postgresql.conf.sample" ; then
> PG_SHAREDIR=$i/
> break;
> fi
>done
>
>if test -n "$PG_SHAREDIR" ; then
> AC_MSG_RESULT(${PG_SHAREDIR}postgresql.conf.sample)
> AC_DEFINE(PG_SHAREDIR_VERIFIED,1,[PostgreSQL sharedir])
>else
> AC_MSG_RESULT(not found)
> AC_MSG_ERROR(
> postgresql.conf.sample not found! Please specify the sharedir
> with --with-pgsharedir=<dir>
> )
>fi
>
>
>(where ${PG_BINDIR} is the result of: pg_config --bindir )
>
>
>

That's foul, and looks horribly fragile too. You have just provided what
seems to me a perfect use case.

cheers

andrew


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_config/share_dir
Date: 2005-09-08 00:39:27
Message-ID: 1653.1126139967@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Andrew Dunstan wrote:
>> pg_config doesn't currently seem to have an option to report the
>> share_dir. Should it?

> Is there a case where a user would need anything from there?

pg_config serves a function of recording the configuration, so I tend
to agree with Andrew that this should be available. I notice that
SYSCONFDIR, PKGINCLUDEDIR, and LOCALEDIR aren't available either.

regards, tom lane


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_config/share_dir
Date: 2005-09-08 00:48:12
Message-ID: 200509080248.12682.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> pg_config serves a function of recording the configuration,

pg_config was meant (as opposed to "serves") to provide information that
is of use for building third-party things. Hence includedir, libdir
for building, pkglibdir for installing. The option --configure records
the configuration, if you like, but I don't see the point of giving
users direct access to directories that they have no use for. I mean,
what would anyone want to do with pg_config --localedir? Certainly not
store the locale files of his own module there. There is a point to be
made that sysconfdir should be exposed, perhaps for the benefit of GUI
configuration editors, but that seems theoretical to me.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_config/share_dir
Date: 2005-09-08 01:03:27
Message-ID: 1803.1126141407@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> what would anyone want to do with pg_config --localedir? Certainly not
> store the locale files of his own module there.

I'm wondering why localedir is even treated as an independently settable
directory in the first place. Why doesn't the code just use PGSHAREDIR
and plaster on a hardwired "/locale"?

> There is a point to be made that sysconfdir should be exposed, perhaps
> for the benefit of GUI configuration editors, but that seems
> theoretical to me.

Certainly we make only minimal use of sysconfdir at present. But we
have the infrastructure for it in configure, path.c, etc, and it seems
to me that pg_config support should be considered part of that
infrastructure. If it's not important enough to be in pg_config, why
is it a separate option at all?

regards, tom lane


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_config/share_dir
Date: 2005-09-08 01:29:11
Message-ID: 200509080329.12628.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> I'm wondering why localedir is even treated as an independently
> settable directory in the first place. Why doesn't the code just use
> PGSHAREDIR and plaster on a hardwired "/locale"?

You can't really set localedir independently; it's hardwired to
$prefix/share/locale (see config/program.m4 for details). The reason
that it's dealt with separately from $datadir ($prefix/share) is to
arrive at a conventional layout when prefix=/usr (or /usr/local etc.).
datadir would then be /usr/share/postgresql and localedir would
be /usr/share/locale. This is just the way most software arranges
these things. Earlier versions of gettext (or non-GNU versions of
gettext?) also had a hard-coded path where it looked for the locale
data, which sort of lead to the convention that the locale files have
to be in that particular directory.

> Certainly we make only minimal use of sysconfdir at present. But we
> have the infrastructure for it in configure, path.c, etc, and it
> seems to me that pg_config support should be considered part of that
> infrastructure. If it's not important enough to be in pg_config, why
> is it a separate option at all?

I'd say that the nonexposure of sysconfdir is an oversight.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Darcy Buskermolen <darcy(at)wavefire(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_config/share_dir
Date: 2005-09-08 01:44:47
Message-ID: 200509080344.47377.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Why do you need access to postgresql.conf.sample?

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Darcy Buskermolen <darcy(at)wavefire(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>
Subject: Re: pg_config/share_dir
Date: 2005-09-08 15:31:34
Message-ID: 200509080831.34575.darcy@wavefire.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wednesday 07 September 2005 18:44, Peter Eisentraut wrote:
> Why do you need access to postgresql.conf.sample?

We don't need access to that file, but install some sql files into the share
dir, the test for postgresql.conf.sample is there just to see if the dir
looks like a likely candidate to be the dir we are infact after..

--
Darcy Buskermolen
Wavefire Technologies Corp.

http://www.wavefire.com
ph: 250.717.0200
fx: 250.763.1759


From: Darcy Buskermolen <darcy(at)wavefire(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>
Subject: Re: pg_config/share_dir
Date: 2005-09-08 15:33:29
Message-ID: 200509080833.30272.darcy@wavefire.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wednesday 07 September 2005 17:31, Andrew Dunstan wrote:
> Darcy Buskermolen wrote:
> >On Wednesday 07 September 2005 15:52, Andrew Dunstan wrote:
> >>Peter Eisentraut wrote:
> >>>Andrew Dunstan wrote:
> >>>>pg_config doesn't currently seem to have an option to report the
> >>>>share_dir. Should it?
> >>>
> >>>Is there a case where a user would need anything from there?
> >
> >the way wo do this in slony is with the following macro:
> >
> >AC_MSG_CHECKING(for postgresql.conf.sample)
> >PGSHARE_POSSIBLE_LOCATIONS="${with_pgsharedir} /usr/local/pgsql/share
> > /usr/local/share/postgresql /usr/share/postgresql /usr/local/share/pgsql
> > /usr/share/pgsql /opt/local/pgsql/share /opt/pgsql/share
> > ${PG_BINDIR}/../share
> >for i in $PGSHARE_POSSIBLE_LOCATIONS; do
> > if test -s "$i/postgresql.conf.sample" ; then
> > PG_SHAREDIR=$i/
> > break;
> > fi
> >done
> >
> >if test -n "$PG_SHAREDIR" ; then
> > AC_MSG_RESULT(${PG_SHAREDIR}postgresql.conf.sample)
> > AC_DEFINE(PG_SHAREDIR_VERIFIED,1,[PostgreSQL sharedir])
> >else
> > AC_MSG_RESULT(not found)
> > AC_MSG_ERROR(
> > postgresql.conf.sample not found! Please specify the sharedir
> > with --with-pgsharedir=<dir>
> > )
> >fi
> >
> >
> >(where ${PG_BINDIR} is the result of: pg_config --bindir )
>
> That's foul, and looks horribly fragile too. You have just provided what
> seems to me a perfect use case.

Yes it is foul :-) but it's the best we could do given the tools we had to
work with..... which is precisely why we provide the failover to
-with-pgsharedir=<dir> incase the system can't get it right.

>
> cheers
>
> andrew
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq

--
Darcy Buskermolen
Wavefire Technologies Corp.

http://www.wavefire.com
ph: 250.717.0200
fx: 250.763.1759


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Darcy Buskermolen <darcy(at)wavefire(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_config/share_dir
Date: 2005-09-08 17:19:59
Message-ID: 200509081919.59644.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Darcy Buskermolen wrote:
> We don't need access to that file, but install some sql files into
> the share dir, the test for postgresql.conf.sample is there just to
> see if the dir looks like a likely candidate to be the dir we are
> infact after..

Then my response is that Slony has absolutely no business installing its
files into one of PostgreSQL's private directories.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Darcy Buskermolen <darcy(at)wavefire(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_config/share_dir
Date: 2005-09-08 18:04:14
Message-ID: 43207D1E.10606@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut wrote:

>Darcy Buskermolen wrote:
>
>
>>We don't need access to that file, but install some sql files into
>>the share dir, the test for postgresql.conf.sample is there just to
>>see if the dir looks like a likely candidate to be the dir we are
>>infact after..
>>
>>
>
>Then my response is that Slony has absolutely no business installing its
>files into one of PostgreSQL's private directories.
>
>

Why be so prescriptive? pgxs already exposes <share_dir>/contrib as an
install target via DATA and DATA_built. Arguably, other modules would be
playing nicer if they put their private stuff in some other private
<share_dir>/subdirectory rather than under contrib.

cheers

andrew


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Darcy Buskermolen <darcy(at)wavefire(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_config/share_dir
Date: 2005-09-08 19:41:03
Message-ID: 200509082141.03712.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Dunstan wrote:
> Why be so prescriptive?

We're not prescribing anything. You can install your stuff anywhere you
want to, but we're certainly not going to encourage or facilitate that
other software installs files in directories that belong to PostgreSQL,
except where this is specifically intended (e.g., $libdir).

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_config/share_dir
Date: 2005-09-23 03:04:23
Message-ID: 200509230304.j8N34N826305@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Added to TODO:

* Add options to pg_config to show the share_dir, sysconfdir,
pkgincludedir, and localedir

---------------------------------------------------------------------------

Tom Lane wrote:
> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> > Andrew Dunstan wrote:
> >> pg_config doesn't currently seem to have an option to report the
> >> share_dir. Should it?
>
> > Is there a case where a user would need anything from there?
>
> pg_config serves a function of recording the configuration, so I tend
> to agree with Andrew that this should be available. I notice that
> SYSCONFDIR, PKGINCLUDEDIR, and LOCALEDIR aren't available either.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_config/share_dir
Date: 2005-09-26 19:04:44
Message-ID: 20050926190444.GR30974@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Should that be marked as a beginner TODO?
On Thu, Sep 22, 2005 at 11:04:23PM -0400, Bruce Momjian wrote:
>
> Added to TODO:
>
> * Add options to pg_config to show the share_dir, sysconfdir,
> pkgincludedir, and localedir
>
>
> ---------------------------------------------------------------------------
>
> Tom Lane wrote:
> > Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> > > Andrew Dunstan wrote:
> > >> pg_config doesn't currently seem to have an option to report the
> > >> share_dir. Should it?
> >
> > > Is there a case where a user would need anything from there?
> >
> > pg_config serves a function of recording the configuration, so I tend
> > to agree with Andrew that this should be available. I notice that
> > SYSCONFDIR, PKGINCLUDEDIR, and LOCALEDIR aren't available either.
> >
> > regards, tom lane
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 9: In versions below 8.0, the planner will ignore your desire to
> > choose an index scan if your joining column's datatypes do not
> > match
> >
>
> --
> Bruce Momjian | http://candle.pha.pa.us
> pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
> + If your life is a hard drive, | 13 Roberts Road
> + Christ can be your backup. | Newtown Square, Pennsylvania 19073
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_config/share_dir
Date: 2005-09-26 19:11:46
Message-ID: 1839.1127761906@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

"Jim C. Nasby" <jnasby(at)pervasive(dot)com> writes:
>> * Add options to pg_config to show the share_dir, sysconfdir,
>> pkgincludedir, and localedir

> Should that be marked as a beginner TODO?

It could, but I think it's going to get DONE in the next few days as
a necessary step in fixing the pgxs relocatability issue. So if any
beginners want to do it, they should step right up.

regards, tom lane