pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
error installing oracle_fdw extension
13+ messages / 6 participants
[nested] [flat]

* error installing oracle_fdw extension
@ 2017-05-19 13:50  Sumeet Shukla <sumeet.k.shukla@gmail.com>
  0 siblings, 1 reply; 13+ messages in thread

From: Sumeet Shukla @ 2017-05-19 13:50 UTC (permalink / raw)
  To: pgsql-admin

Hi,

I'm seeeing below error while installing oracle_fdw

-bash-4.1$ cd
/opt/postgresql/9.6/share/postgresql/extension/oracle_fdw-1.1.0
-bash-4.1$ export PATH=/opt/postgresql/9.6/bin:$PATH
-bash-4.1$ export ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/db_1
-bash-4.1$ export LD_LIBRARY_PATH=/u01/app/oracle/product/
12.1.0.2/db_1/lib:/lib:/usr/lib
-bash-4.1$ make
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -g -O2 -DMAP_HUGETLB=0x40000
-fpic -I/u01/app/oracle/product/12.1.0.2/db_1/sdk/include
-I/u01/app/oracle/product/12.1.0.2/db_1/oci/include
-I/u01/app/oracle/product/12.1.0.2/db_1/rdbms/public
-I/usr/include/oracle/12.1/client -I/usr/include/oracle/12.1/client64
-I/usr/include/oracle/11.2/client -I/usr/include/oracle/11.2/client64
-I/usr/include/oracle/11.1/client -I/usr/include/oracle/11.1/client64
-I/usr/include/oracle/10.2.0.5/client -I/usr/include/oracle/
10.2.0.5/client64 -I/usr/include/oracle/10.2.0.4/client
-I/usr/include/oracle/10.2.0.4/client64 -I/usr/include/oracle/
10.2.0.3/client -I/usr/include/oracle/10.2.0.3/client64 -I. -I./
-I/opt/postgresql/9.6/include/postgresql/server
-I/opt/postgresql/9.6/include/postgresql/internal -D_GNU_SOURCE
 -I/opt/local/Current/include/libxml2 -I/opt/local/Current/include  -c -o
oracle_fdw.o oracle_fdw.c
oracle_fdw.c: In function ‘oracle_fdw_handler’:
oracle_fdw.c:269: warning: assignment from incompatible pointer type
oracle_fdw.c: In function ‘oracle_diag’:
oracle_fdw.c:441: error: too few arguments to function
‘GetConfigOptionByName’
oracle_fdw.c: In function ‘oracleGetForeignRelSize’:
oracle_fdw.c:751: error: ‘RelOptInfo’ has no member named ‘width’
oracle_fdw.c: In function ‘oracleGetForeignPaths’:
oracle_fdw.c:800: error: incompatible type for argument 3 of
‘create_foreignscan_path’
/opt/postgresql/9.6/include/postgresql/server/optimizer/pathnode.h:90:
note: expected ‘struct PathTarget *’ but argument is of type ‘double’
oracle_fdw.c:800: error: incompatible type for argument 6 of
‘create_foreignscan_path’
/opt/postgresql/9.6/include/postgresql/server/optimizer/pathnode.h:90:
note: expected ‘Cost’ but argument is of type ‘struct List *’
oracle_fdw.c:800: warning: passing argument 8 of ‘create_foreignscan_path’
from incompatible pointer type
/opt/postgresql/9.6/include/postgresql/server/optimizer/pathnode.h:90:
note: expected ‘Relids’ but argument is of type ‘struct List *’
oracle_fdw.c:800: error: too few arguments to function
‘create_foreignscan_path’
oracle_fdw.c: In function ‘oracleGetForeignPlan’:
oracle_fdw.c:839: error: too few arguments to function ‘make_foreignscan’
oracle_fdw.c: In function ‘oraclePlanForeignModify’:
oracle_fdw.c:1226: error: ‘RangeTblEntry’ has no member named ‘modifiedCols’
oracle_fdw.c: In function ‘createQuery’:
oracle_fdw.c:1964: error: ‘RelOptInfo’ has no member named ‘reltargetlist’
oracle_fdw.c: In function ‘getOracleWhereClause’:
oracle_fdw.c:2609: error: too few arguments to function
‘array_create_iterator’
oracle_fdw.c: In function ‘transactionCallback’:
oracle_fdw.c:4262: warning: enumeration value ‘XACT_EVENT_PARALLEL_COMMIT’
not handled in switch
oracle_fdw.c:4262: warning: enumeration value ‘XACT_EVENT_PARALLEL_ABORT’
not handled in switch
oracle_fdw.c:4262: warning: enumeration value
‘XACT_EVENT_PARALLEL_PRE_COMMIT’ not handled in switch
make: *** [oracle_fdw.o] Error 1


Can someone help me with this.

Thanks & Regards,
Sumeet Shukla
Ph. No. 962 323 4700

^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: error installing oracle_fdw extension
@ 2017-05-19 14:41  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Sumeet Shukla <sumeet.k.shukla@gmail.com>
  0 siblings, 1 reply; 13+ messages in thread

From: Tom Lane @ 2017-05-19 14:41 UTC (permalink / raw)
  To: Sumeet Shukla <sumeet.k.shukla@gmail.com>; +Cc: pgsql-admin

Sumeet Shukla <sumeet.k.shukla@gmail.com> writes:
> I'm seeeing below error while installing oracle_fdw

Looks like the version of oracle_fdw you're trying to install has
not been updated for PG 9.6.  You need to ask its developers
whether there's a newer version.

			regards, tom lane


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



^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: error installing oracle_fdw extension
@ 2017-05-19 18:53  Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 13+ messages in thread

From: Peter Eisentraut @ 2017-05-19 18:53 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; Sumeet Shukla <sumeet.k.shukla@gmail.com>; +Cc: pgsql-admin

On 5/19/17 10:41, Tom Lane wrote:
> Sumeet Shukla <sumeet.k.shukla@gmail.com> writes:
>> I'm seeeing below error while installing oracle_fdw
> 
> Looks like the version of oracle_fdw you're trying to install has
> not been updated for PG 9.6.  You need to ask its developers
> whether there's a newer version.

Yes, there are newer versions that support 9.6 and 10.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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



^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: error installing oracle_fdw extension
@ 2017-05-22 05:56  Sumeet Shukla <sumeet.k.shukla@gmail.com>
  parent: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  0 siblings, 1 reply; 13+ messages in thread

From: Sumeet Shukla @ 2017-05-22 05:56 UTC (permalink / raw)
  To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-admin

Thanks Tom and Peter. I tried installing the latest version
oracle_fdw-1.5.0 and now I see below error:

-bash-4.1$ make
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -g -O2 -DMAP_HUGETLB=0x40000
-fpic -I/u01/app/oracle/product/12.1.0.2/db_1/sdk/include
-I/u01/app/oracle/product/12.1.0.2/db_1/oci/include
-I/u01/app/oracle/product/12.1.0.2/db_1/rdbms/public
-I/usr/include/oracle/12.1/client -I/usr/include/oracle/12.1/client64
-I/usr/include/oracle/11.2/client -I/usr/include/oracle/11.2/client64
-I/usr/include/oracle/11.1/client -I/usr/include/oracle/11.1/client64
-I/usr/include/oracle/10.2.0.5/client -I/usr/include/oracle/
10.2.0.5/client64 -I/usr/include/oracle/10.2.0.4/client
-I/usr/include/oracle/10.2.0.4/client64 -I/usr/include/oracle/
10.2.0.3/client -I/usr/include/oracle/10.2.0.3/client64 -I. -I./
-I/opt/postgresql/9.6/include/postgresql/server
-I/opt/postgresql/9.6/include/postgresql/internal -D_GNU_SOURCE
 -I/opt/local/Current/include/libxml2 -I/opt/local/Current/include  -c -o
oracle_utils.o oracle_utils.c
oracle_utils.c:22:17: error: oci.h: No such file or directory
oracle_utils.c:35: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘err_code’
oracle_utils.c:48: error: expected specifier-qualifier-list before ‘dvoid’
oracle_utils.c:69: error: expected declaration specifiers or ‘...’ before
‘dvoid’
oracle_utils.c:69: error: expected declaration specifiers or ‘...’ before
‘sb4’
oracle_utils.c:69: error: expected declaration specifiers or ‘...’ before
‘ub2’
oracle_utils.c:69: error: expected declaration specifiers or ‘...’ before
‘ub2’
oracle_utils.c:69: error: expected declaration specifiers or ‘...’ before
‘sb2’
oracle_utils.c:70: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘checkerr’
oracle_utils.c:72: error: expected ‘)’ before ‘*’ token


Thanks & Regards,
Sumeet Shukla


On Sat, May 20, 2017 at 12:23 AM, Peter Eisentraut <
peter.eisentraut@2ndquadrant.com> wrote:

> On 5/19/17 10:41, Tom Lane wrote:
> > Sumeet Shukla <sumeet.k.shukla@gmail.com> writes:
> >> I'm seeeing below error while installing oracle_fdw
> >
> > Looks like the version of oracle_fdw you're trying to install has
> > not been updated for PG 9.6.  You need to ask its developers
> > whether there's a newer version.
>
> Yes, there are newer versions that support 9.6 and 10.
>
> --
> Peter Eisentraut              http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>

^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: error installing oracle_fdw extension
@ 2017-05-22 06:30  Julien Rouhaud <julien.rouhaud@dalibo.com>
  parent: Sumeet Shukla <sumeet.k.shukla@gmail.com>
  0 siblings, 1 reply; 13+ messages in thread

From: Julien Rouhaud @ 2017-05-22 06:30 UTC (permalink / raw)
  To: Sumeet Shukla <sumeet.k.shukla@gmail.com>; Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-admin; laurenz.albe@wien.gv.at

Adding Laurenz

On 22/05/2017 07:56, Sumeet Shukla wrote:
> Thanks Tom and Peter. I tried installing the latest version
> oracle_fdw-1.5.0 and now I see below error:
> 
> -bash-4.1$ make
> gcc -Wall -Wmissing-prototypes -Wpointer-arith
> -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
> -Wformat-security -fno-strict-aliasing -fwrapv -g -O2
> -DMAP_HUGETLB=0x40000 -fpic
> -I/u01/app/oracle/product/12.1.0.2/db_1/sdk/include
> <http://12.1.0.2/db_1/sdk/include;
> -I/u01/app/oracle/product/12.1.0.2/db_1/oci/include
> <http://12.1.0.2/db_1/oci/include;
> -I/u01/app/oracle/product/12.1.0.2/db_1/rdbms/public
> <http://12.1.0.2/db_1/rdbms/public; -I/usr/include/oracle/12.1/client
> -I/usr/include/oracle/12.1/client64 -I/usr/include/oracle/11.2/client
> -I/usr/include/oracle/11.2/client64 -I/usr/include/oracle/11.1/client
> -I/usr/include/oracle/11.1/client64
> -I/usr/include/oracle/10.2.0.5/client <http://10.2.0.5/client;
> -I/usr/include/oracle/10.2.0.5/client64 <http://10.2.0.5/client64;
> -I/usr/include/oracle/10.2.0.4/client <http://10.2.0.4/client;
> -I/usr/include/oracle/10.2.0.4/client64 <http://10.2.0.4/client64;
> -I/usr/include/oracle/10.2.0.3/client <http://10.2.0.3/client;
> -I/usr/include/oracle/10.2.0.3/client64 <http://10.2.0.3/client64; -I.
> -I./ -I/opt/postgresql/9.6/include/postgresql/server
> -I/opt/postgresql/9.6/include/postgresql/internal -D_GNU_SOURCE
>  -I/opt/local/Current/include/libxml2 -I/opt/local/Current/include  -c
> -o oracle_utils.o oracle_utils.c
> oracle_utils.c:22:17: error: oci.h: No such file or directory
Did you also install Oracle SDK files in the directory pointed by
$ORACLE_HOME?

-- 
Julien Rouhaud
http://dalibo.com - http://dalibo.org


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



^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: error installing oracle_fdw extension
@ 2017-05-22 08:14  Sumeet Shukla <sumeet.k.shukla@gmail.com>
  parent: Julien Rouhaud <julien.rouhaud@dalibo.com>
  0 siblings, 1 reply; 13+ messages in thread

From: Sumeet Shukla @ 2017-05-22 08:14 UTC (permalink / raw)
  To: Julien Rouhaud <julien.rouhaud@dalibo.com>; +Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-admin; laurenz.albe@wien.gv.at

Hi,

I have below environment variables set:

export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib:$LD_LIBRARY_PATH
export ORACLE_HOME=/usr/lib/oracle/12.1/client64
PATH=$PATH:/usr/lib/oracle/12.1/client64/bin:/usr/lib/oracle/12.1/client64/lib:/usr/lib/oracle/12.1/client64:/usr/lib/oracle/12.1/client64/sdk
export PATH

The file /opt/postgresql/9.6/lib/postgresql/oracle_fdw.so is available.

I have also added "include /usr/lib/oracle/12.1/client64/lib" in
/etc/ld.so.conf

I still see below error when I perform "create extension oracle_fdw;"

ERROR: could not load library
"/opt/postgresql/9.6/lib/postgresql/oracle_fdw.so": libclntsh.so.12.1:
cannot open shared object file: No such file or directory


Thanks & Regards,
Sumeet Shukla


On Mon, May 22, 2017 at 12:00 PM, Julien Rouhaud <julien.rouhaud@dalibo.com>
wrote:

> Adding Laurenz
>
> On 22/05/2017 07:56, Sumeet Shukla wrote:
> > Thanks Tom and Peter. I tried installing the latest version
> > oracle_fdw-1.5.0 and now I see below error:
> >
> > -bash-4.1$ make
> > gcc -Wall -Wmissing-prototypes -Wpointer-arith
> > -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
> > -Wformat-security -fno-strict-aliasing -fwrapv -g -O2
> > -DMAP_HUGETLB=0x40000 -fpic
> > -I/u01/app/oracle/product/12.1.0.2/db_1/sdk/include
> > <http://12.1.0.2/db_1/sdk/include;
> > -I/u01/app/oracle/product/12.1.0.2/db_1/oci/include
> > <http://12.1.0.2/db_1/oci/include;
> > -I/u01/app/oracle/product/12.1.0.2/db_1/rdbms/public
> > <http://12.1.0.2/db_1/rdbms/public; -I/usr/include/oracle/12.1/client
> > -I/usr/include/oracle/12.1/client64 -I/usr/include/oracle/11.2/client
> > -I/usr/include/oracle/11.2/client64 -I/usr/include/oracle/11.1/client
> > -I/usr/include/oracle/11.1/client64
> > -I/usr/include/oracle/10.2.0.5/client <http://10.2.0.5/client;
> > -I/usr/include/oracle/10.2.0.5/client64 <http://10.2.0.5/client64;
> > -I/usr/include/oracle/10.2.0.4/client <http://10.2.0.4/client;
> > -I/usr/include/oracle/10.2.0.4/client64 <http://10.2.0.4/client64;
> > -I/usr/include/oracle/10.2.0.3/client <http://10.2.0.3/client;
> > -I/usr/include/oracle/10.2.0.3/client64 <http://10.2.0.3/client64; -I.
> > -I./ -I/opt/postgresql/9.6/include/postgresql/server
> > -I/opt/postgresql/9.6/include/postgresql/internal -D_GNU_SOURCE
> >  -I/opt/local/Current/include/libxml2 -I/opt/local/Current/include  -c
> > -o oracle_utils.o oracle_utils.c
> > oracle_utils.c:22:17: error: oci.h: No such file or directory
> Did you also install Oracle SDK files in the directory pointed by
> $ORACLE_HOME?
>
> --
> Julien Rouhaud
> http://dalibo.com - http://dalibo.org
>

^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: error installing oracle_fdw extension
@ 2017-05-22 08:54  Albe Laurenz <laurenz.albe@wien.gv.at>
  parent: Sumeet Shukla <sumeet.k.shukla@gmail.com>
  0 siblings, 1 reply; 13+ messages in thread

From: Albe Laurenz @ 2017-05-22 08:54 UTC (permalink / raw)
  To: 'Sumeet Shukla *EXTERN*' <sumeet.k.shukla@gmail.com>; +Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-admin; Julien Rouhaud <julien.rouhaud@dalibo.com>

Sumeet Shukla wrote:
> I have below environment variables set:
> 
> 
> export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib:$LD_LIBRARY_PATH
> export ORACLE_HOME=/usr/lib/oracle/12.1/client64
> PATH=$PATH:/usr/lib/oracle/12.1/client64/bin:/usr/lib/oracle/12.1/client64/lib:/usr/lib/or
> acle/12.1/client64:/usr/lib/oracle/12.1/client64/sdk
> export PATH
> 
> The file /opt/postgresql/9.6/lib/postgresql/oracle_fdw.so is available.
> 
> I have also added "include /usr/lib/oracle/12.1/client64/lib" in /etc/ld.so.conf
> 
> I still see below error when I perform "create extension oracle_fdw;"
> 
> 
> ERROR: could not load library "/opt/postgresql/9.6/lib/postgresql/oracle_fdw.so":
> libclntsh.so.12.1: cannot open shared object file: No such file or directory

Two possibilities:

- There is no libclntsh.so.12.1 in /usr/lib/oracle/12.1/client64/lib
- The environment variable LD_LIBRARY_PATH is not set in the postmaster's environment.

For the latter (assuming you are using Linux), find out the process ID of the
PostgreSQL server process (postmaster).

Assuming it is 12345, run this:
$ cat /proc/1234/environ | xargs -n 1 -0 echo

And see if LD_LIBRARY_PATH is set correctly there.

Yours,
Laurenz Albe

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


^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: error installing oracle_fdw extension
@ 2017-05-22 09:24  Sumeet Shukla <sumeet.k.shukla@gmail.com>
  parent: Albe Laurenz <laurenz.albe@wien.gv.at>
  0 siblings, 1 reply; 13+ messages in thread

From: Sumeet Shukla @ 2017-05-22 09:24 UTC (permalink / raw)
  To: Albe Laurenz <laurenz.albe@wien.gv.at>; +Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-admin; Julien Rouhaud <julien.rouhaud@dalibo.com>

Yes, postmaster does not seem to be aware of  LD_LIBRARY_PATH. I tried
ldconfig and postgres service restart but it does not seem to work. How can
I fix this.

Also the owner of  /usr/lib/oracle/12.1/client64/lib/libclntsh.so.12.1 is
root. Please confirm if it is OK.

Thanks & Regards,
Sumeet Shukla
Ph. No. 962 323 4700

On Mon, May 22, 2017 at 2:24 PM, Albe Laurenz <laurenz.albe@wien.gv.at>
wrote:

> Sumeet Shukla wrote:
> > I have below environment variables set:
> >
> >
> > export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib:$LD_
> LIBRARY_PATH
> > export ORACLE_HOME=/usr/lib/oracle/12.1/client64
> > PATH=$PATH:/usr/lib/oracle/12.1/client64/bin:/usr/lib/
> oracle/12.1/client64/lib:/usr/lib/or
> > acle/12.1/client64:/usr/lib/oracle/12.1/client64/sdk
> > export PATH
> >
> > The file /opt/postgresql/9.6/lib/postgresql/oracle_fdw.so is available.
> >
> > I have also added "include /usr/lib/oracle/12.1/client64/lib" in
> /etc/ld.so.conf
> >
> > I still see below error when I perform "create extension oracle_fdw;"
> >
> >
> > ERROR: could not load library "/opt/postgresql/9.6/lib/
> postgresql/oracle_fdw.so":
> > libclntsh.so.12.1: cannot open shared object file: No such file or
> directory
>
> Two possibilities:
>
> - There is no libclntsh.so.12.1 in /usr/lib/oracle/12.1/client64/lib
> - The environment variable LD_LIBRARY_PATH is not set in the postmaster's
> environment.
>
> For the latter (assuming you are using Linux), find out the process ID of
> the
> PostgreSQL server process (postmaster).
>
> Assuming it is 12345, run this:
> $ cat /proc/1234/environ | xargs -n 1 -0 echo
>
> And see if LD_LIBRARY_PATH is set correctly there.
>
> Yours,
> Laurenz Albe
>

^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: error installing oracle_fdw extension
@ 2017-05-22 13:12  Albe Laurenz <laurenz.albe@wien.gv.at>
  parent: Sumeet Shukla <sumeet.k.shukla@gmail.com>
  0 siblings, 1 reply; 13+ messages in thread

From: Albe Laurenz @ 2017-05-22 13:12 UTC (permalink / raw)
  To: 'Sumeet Shukla *EXTERN*' <sumeet.k.shukla@gmail.com>; +Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-admin; Julien Rouhaud <julien.rouhaud@dalibo.com>

Sumeet Shukla wrote:
> Yes, postmaster does not seem to be aware of  LD_LIBRARY_PATH. I tried ldconfig and
> postgres service restart but it does not seem to work. How can I fix this.

You first have to add a line to /etc/ld.so.conf that reads
/usr/lib/oracle/12.1/client64/lib

Then run "ldconfig".

> Also the owner of  /usr/lib/oracle/12.1/client64/lib/libclntsh.so.12.1 is root. Please
> confirm if it is OK.

Yes, as long as the PostgreSQL user has permission to read the file.

Yours,
Laurenz Albe

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


^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: error installing oracle_fdw extension
@ 2017-05-22 14:53  Cachique <cachique@gmail.com>
  parent: Albe Laurenz <laurenz.albe@wien.gv.at>
  0 siblings, 1 reply; 13+ messages in thread

From: Cachique @ 2017-05-22 14:53 UTC (permalink / raw)
  To: Albe Laurenz <laurenz.albe@wien.gv.at>; +Cc: Sumeet Shukla *EXTERN* <sumeet.k.shukla@gmail.com>; Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-admin; Julien Rouhaud <julien.rouhaud@dalibo.com>

Hi.
I had this problem a while ago.
It has to do with the way systemd handles environment variables. Apparently
systemd isn't aware of exports of variables. It uses a special section in a
special file.
Using this post (
https://serverfault.com/questions/413397/how-to-set-environment-variable-in-systemd-service
) I managed to create the extension.

Steps to follow...
* You need to create a directory inside /etc/systemd/system/
  and name it the same as your service with suffix .d ->
postgresql-9.5.service.d
* Put inside a file (name is not important) with extension .conf ->
orafwd.conf
* In that file specify a section [Service] with your Oracle environment
variables.
  Something like this...
[Service]
Environment=ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
Environment=TNS_ADMIN=/u01/app/oracle/product/11.2.0/xe/network/admin
* Article says you can use *systemctl edit yourservice* but I didn't tried
that. Just created the directory and file by myself.
* Names and paths may vary according to your distribution and likes.

Resuming
You have this file...
/etc/systemd/system/postgresql-9.5.service.d/orafdw.conf
With content...
[Service]
Environment=ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
Environment=TNS_ADMIN=/u01/app/oracle/product/11.2.0/xe/network/admin


Check.
When you run systemctl status postgres you see the config file included

[root@localhost ~]# systemctl status postgresql-9.5.service
● postgresql-9.5.service - PostgreSQL 9.5 database server
   Loaded: loaded (/usr/lib/systemd/system/postgresql-9.5.service; enabled;
vendor preset: disabled)
  Drop-In: /etc/systemd/system/postgresql-9.5.service.d
           └─orafdw.conf
   Active: active (running) since Wed 2017-05-17 12:11:49 PYT; 4 days ago






Regards,
Walter






On Mon, May 22, 2017 at 9:12 AM, Albe Laurenz <laurenz.albe@wien.gv.at>
wrote:

> Sumeet Shukla wrote:
> > Yes, postmaster does not seem to be aware of  LD_LIBRARY_PATH. I tried
> ldconfig and
> > postgres service restart but it does not seem to work. How can I fix
> this.
>
> You first have to add a line to /etc/ld.so.conf that reads
> /usr/lib/oracle/12.1/client64/lib
>
> Then run "ldconfig".
>
> > Also the owner of  /usr/lib/oracle/12.1/client64/lib/libclntsh.so.12.1
> is root. Please
> > confirm if it is OK.
>
> Yes, as long as the PostgreSQL user has permission to read the file.
>
> Yours,
> Laurenz Albe
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>

^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: error installing oracle_fdw extension
@ 2017-05-23 07:53  Sumeet Shukla <sumeet.k.shukla@gmail.com>
  parent: Cachique <cachique@gmail.com>
  0 siblings, 1 reply; 13+ messages in thread

From: Sumeet Shukla @ 2017-05-23 07:53 UTC (permalink / raw)
  To: Cachique <cachique@gmail.com>; +Cc: Albe Laurenz <laurenz.albe@wien.gv.at>; Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-admin; Julien Rouhaud <julien.rouhaud@dalibo.com>

Thank You All for jumping in for the help. I was able to install it
finally. The problem was with the way I was restarting postgresql service.

The environment variable $LD_LIBRARY_PATH reflects if I use
"*/etc/init.d/postgresql-9.6
restart" command *but it does not reflect if I use "*service postgresql-9.6
restart*".

I find it little weird since essentially both the commands are internally
calling the same service file. Any insight on this would be appreciated.

Warm Regards,
Sumeet Shukla


On Mon, May 22, 2017 at 8:23 PM, Cachique <cachique@gmail.com> wrote:

> Hi.
> I had this problem a while ago.
> It has to do with the way systemd handles environment variables.
> Apparently systemd isn't aware of exports of variables. It uses a special
> section in a special file.
> Using this post ( https://serverfault.com/questions/413397/how-to-set-
> environment-variable-in-systemd-service ) I managed to create the
> extension.
>
> Steps to follow...
> * You need to create a directory inside /etc/systemd/system/
>   and name it the same as your service with suffix .d ->
> postgresql-9.5.service.d
> * Put inside a file (name is not important) with extension .conf ->
> orafwd.conf
> * In that file specify a section [Service] with your Oracle environment
> variables.
>   Something like this...
> [Service]
> Environment=ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
> Environment=TNS_ADMIN=/u01/app/oracle/product/11.2.0/xe/network/admin
> * Article says you can use *systemctl edit yourservice* but I didn't
> tried that. Just created the directory and file by myself.
> * Names and paths may vary according to your distribution and likes.
>
> Resuming
> You have this file...
> /etc/systemd/system/postgresql-9.5.service.d/orafdw.conf
> With content...
> [Service]
> Environment=ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
> Environment=TNS_ADMIN=/u01/app/oracle/product/11.2.0/xe/network/admin
>
>
> Check.
> When you run systemctl status postgres you see the config file included
>
> [root@localhost ~]# systemctl status postgresql-9.5.service
> ● postgresql-9.5.service - PostgreSQL 9.5 database server
>    Loaded: loaded (/usr/lib/systemd/system/postgresql-9.5.service;
> enabled; vendor preset: disabled)
>   Drop-In: /etc/systemd/system/postgresql-9.5.service.d
>            └─orafdw.conf
>    Active: active (running) since Wed 2017-05-17 12:11:49 PYT; 4 days ago
>
>
>
>
>
>
> Regards,
> Walter
>
>
>
>
>
>
> On Mon, May 22, 2017 at 9:12 AM, Albe Laurenz <laurenz.albe@wien.gv.at>
> wrote:
>
>> Sumeet Shukla wrote:
>> > Yes, postmaster does not seem to be aware of  LD_LIBRARY_PATH. I tried
>> ldconfig and
>> > postgres service restart but it does not seem to work. How can I fix
>> this.
>>
>> You first have to add a line to /etc/ld.so.conf that reads
>> /usr/lib/oracle/12.1/client64/lib
>>
>> Then run "ldconfig".
>>
>> > Also the owner of  /usr/lib/oracle/12.1/client64/lib/libclntsh.so.12.1
>> is root. Please
>> > confirm if it is OK.
>>
>> Yes, as long as the PostgreSQL user has permission to read the file.
>>
>> Yours,
>> Laurenz Albe
>>
>> --
>> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-admin
>>
>
>

^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: error installing oracle_fdw extension
@ 2017-05-23 09:04  Albe Laurenz <laurenz.albe@wien.gv.at>
  parent: Sumeet Shukla <sumeet.k.shukla@gmail.com>
  0 siblings, 1 reply; 13+ messages in thread

From: Albe Laurenz @ 2017-05-23 09:04 UTC (permalink / raw)
  To: 'Sumeet Shukla *EXTERN*' <sumeet.k.shukla@gmail.com>; Cachique <cachique@gmail.com>; +Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; Tom Lane <tgl@sss.pgh.pa.us>; pgsql-admin; Julien Rouhaud <julien.rouhaud@dalibo.com>

Sumeet Shukla wrote:
> The environment variable $LD_LIBRARY_PATH reflects if I use "/etc/init.d/postgresql-9.6
> restart" command but it does not reflect if I use "service postgresql-9.6 restart".
> 
> I find it little weird since essentially both the commands are internally calling the same
> service file. Any insight on this would be appreciated.

From "man service":

   ENVIRONMENT
      LANG, TERM
         The only environment variables passed to the init scripts.

Yours,
Laurenz Albe

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


^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: error installing oracle_fdw extension
@ 2017-05-26 21:16  Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  parent: Albe Laurenz <laurenz.albe@wien.gv.at>
  0 siblings, 0 replies; 13+ messages in thread

From: Peter Eisentraut @ 2017-05-26 21:16 UTC (permalink / raw)
  To: Albe Laurenz <laurenz.albe@wien.gv.at>; Sumeet Shukla *EXTERN* <sumeet.k.shukla@gmail.com>; Cachique <cachique@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-admin; Julien Rouhaud <julien.rouhaud@dalibo.com>

On 5/23/17 05:04, Albe Laurenz wrote:
> Sumeet Shukla wrote:
>> The environment variable $LD_LIBRARY_PATH reflects if I use "/etc/init.d/postgresql-9.6
>> restart" command but it does not reflect if I use "service postgresql-9.6 restart".
>>
>> I find it little weird since essentially both the commands are internally calling the same
>> service file. Any insight on this would be appreciated.
> 
> From "man service":
> 
>    ENVIRONMENT
>       LANG, TERM
>          The only environment variables passed to the init scripts.

Yeah, one of the main points of the service program is that it clears
your environment.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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



^ permalink  raw  reply  [nested|flat] 13+ messages in thread


end of thread, other threads:[~2017-05-26 21:16 UTC | newest]

Thread overview: 13+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-05-19 13:50 error installing oracle_fdw extension Sumeet Shukla <sumeet.k.shukla@gmail.com>
2017-05-19 14:41 ` Tom Lane <tgl@sss.pgh.pa.us>
2017-05-19 18:53   ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2017-05-22 05:56     ` Sumeet Shukla <sumeet.k.shukla@gmail.com>
2017-05-22 06:30       ` Julien Rouhaud <julien.rouhaud@dalibo.com>
2017-05-22 08:14         ` Sumeet Shukla <sumeet.k.shukla@gmail.com>
2017-05-22 08:54           ` Albe Laurenz <laurenz.albe@wien.gv.at>
2017-05-22 09:24             ` Sumeet Shukla <sumeet.k.shukla@gmail.com>
2017-05-22 13:12               ` Albe Laurenz <laurenz.albe@wien.gv.at>
2017-05-22 14:53                 ` Cachique <cachique@gmail.com>
2017-05-23 07:53                   ` Sumeet Shukla <sumeet.k.shukla@gmail.com>
2017-05-23 09:04                     ` Albe Laurenz <laurenz.albe@wien.gv.at>
2017-05-26 21:16                       ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox