How to find out extension directory

Started by Rakesh Kumarover 8 years ago5 messagesgeneral
Jump to latest
#1Rakesh Kumar
rakeshkumar464@outlook.com

I am documenting on automating installation of pgaudit extension for
containers. On my laptop I see that the directory where the files
pgaudit.control and pgaudit--1.2.sql needs to be present is

/usr/share/postgresql/10/extension.

How do I know beforehand where the dir path is ?

--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html

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

#2Melvin Davidson
melvin6925@gmail.com
In reply to: Rakesh Kumar (#1)
Re: How to find out extension directory

On Fri, Oct 20, 2017 at 4:12 PM, rakeshkumar464 <rakeshkumar464@outlook.com>
wrote:

I am documenting on automating installation of pgaudit extension for
containers. On my laptop I see that the directory where the files
pgaudit.control and pgaudit--1.2.sql needs to be present is

/usr/share/postgresql/10/extension.

How do I know beforehand where the dir path is ?

--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-
f1843780.html

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

How do I know beforehand where the dir path is ?

That would depend on the O/S, but it is not really necessary to know the
path, as PostgreSQL will know it.
Simply establish a connection to the database you want to create the
extension in and do

*CREATE EXTENSION extention_name;*

https://www.postgresql.org/docs/10/static/sql-createextension.html

--
*Melvin Davidson*
I reserve the right to fantasize. Whether or not you
wish to share my fantasy is entirely up to you.

#3David G. Johnston
david.g.johnston@gmail.com
In reply to: Rakesh Kumar (#1)
Re: How to find out extension directory

On Fri, Oct 20, 2017 at 1:12 PM, rakeshkumar464 <rakeshkumar464@outlook.com>
wrote:

I am documenting on automating installation of pgaudit extension for
containers. On my laptop I see that the directory where the files
pgaudit.control and pgaudit--1.2.sql needs to be present is

/usr/share/postgresql/10/extension.

How do I know beforehand where the dir path is ?

I think pg_config (
https://www.postgresql.org/docs/current/static/app-pgconfig.html ) is what
you are looking for.

David J.

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: David G. Johnston (#3)
Re: How to find out extension directory

"David G. Johnston" <david.g.johnston@gmail.com> writes:

On Fri, Oct 20, 2017 at 1:12 PM, rakeshkumar464 <rakeshkumar464@outlook.com>
wrote:

How do I know beforehand where the dir path is ?

I think pg_config (
https://www.postgresql.org/docs/current/static/app-pgconfig.html ) is what
you are looking for.

specifically, you can assume it's the "extension" subdirectory of
whatever SHAREDIR is. "pg_config --sharedir" will tell you that.

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

#5Joe Conway
mail@joeconway.com
In reply to: Tom Lane (#4)
Re: How to find out extension directory

On 10/20/2017 02:10 PM, Tom Lane wrote:

"David G. Johnston" <david.g.johnston@gmail.com> writes:

On Fri, Oct 20, 2017 at 1:12 PM, rakeshkumar464 <rakeshkumar464@outlook.com>
wrote:

How do I know beforehand where the dir path is ?

I think pg_config (
https://www.postgresql.org/docs/current/static/app-pgconfig.html ) is what
you are looking for.

specifically, you can assume it's the "extension" subdirectory of
whatever SHAREDIR is. "pg_config --sharedir" will tell you that.

And starting with pg 9.6 you can also do:

test=# select * from pg_config where name = 'SHAREDIR';
name | setting
----------+--------------------------------------
SHAREDIR | /usr/local/pgsql-REL_10_STABLE/share
(1 row)

--
Crunchy Data - http://crunchydata.com
PostgreSQL Support for Secure Enterprises
Consulting, Training, & Open Source Development