tds_fdw >> Install Foreign data Wrapper on EDB Postgres to connect to SQL server database

2024-05-28 Thread Sumit Kochar
Installation of Foreign data Wrapper on EDB Postgres to connect to SQL server 
database is not working.

https://github.com/tds-fdw/tds_fdw/issues/357

Please advise if this has been encountered or a workaround is available.

OS:

NAME="Oracle Linux Server"
VERSION="7.9"
ID="ol"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.9"
PRETTY_NAME="Oracle Linux Server 7.9"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:7:9:server"
HOME_URL=https://linux.oracle.com/
BUG_REPORT_URL=https://github.com/oracle/oracle-linux

ORACLE_BUGZILLA_PRODUCT="Oracle Linux 7"
ORACLE_BUGZILLA_PRODUCT_VERSION=7.9
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=7.9


Version of tds_fdw:

postgres=# \dx

  List of installed extensions

   Name   | Version |   Schema   | Description

--+-++--

 edb_dblink_libpq | 1.0 | pg_catalog | EnterpriseDB Foreign Data Wrapper 
for PostgreSQL

 edb_dblink_oci   | 1.0 | pg_catalog | EnterpriseDB Foreign Data Wrapper 
for Oracle

 edbspl   | 1.0 | pg_catalog | EDB-SPL procedural language

 pldbgapi | 1.1 | pg_catalog | server-side support for debugging 
PL/pgSQL functions

 plpgsql  | 1.0 | pg_catalog | PL/pgSQL procedural language

(5 rows)


PostgreSQL Version:


postgres=# SELECT version();

 version

--

 PostgreSQL 13.13 (EnterpriseDB Advanced Server 13.13.19) on 
x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 
64-bit

(1 row)


Issue Details:


tds_fdw install steps performed:





yum install install edb-as13-server edb-as13-server-libs edb-as13-server-devel

yum install -y gcc make wget epel-release freetds freetds-devel

dnf install redhat-rpm-config

subscription-manager repos --enable rhel-7-server-optional-rpms \

--enable rhel-server-rhscl-7-rpms \

--enable rhel-7-server-devtools-rpms

yum install llvm-toolset-7-clang-analyzer llvm-toolset-7-clang-tools-extra 
llvm-toolset-7 llvm-toolset-7-clang llvm-toolset-7-clang-libs  
llvm-toolset-7-llvm-libs





export TDS_FDW_VERSION="2.0.3"

wget https://github.com/tds-fdw/tds_fdw/archive/refs/tags/v2.0.3.tar.gz -O 
tds_fdw-${TDS_FDW_VERSION}.tar.gz

tar -xvzf tds_fdw-${TDS_FDW_VERSION}.tar.gz

cd tds_fdw-${TDS_FDW_VERSION}

PATH=/usr/edb/as13/bin:$PATH

make USE_PGXS=1

PATH=/usr/edb/as13/bin:$PATH

make USE_PGXS=1 install





Logs:





[root@hostip ~]# yum install install edb-as13-server edb-as13-server-libs 
edb-as13-server-devel\

Loaded plugins: rhnplugin\

This system is not registered with Spacewalk server.\

You can use rhn_register to register.\

Spacewalk support will be disabled.\

Repository mc-ol7-base-x86_64 is listed more than once in the configuration\

Repository mc-ol7-layered-x86_64 is listed more than once in the configuration\

Repository mc-ol7_tsm-8.1.13_x86_64 is listed more than once in the 
configuration\

Repository mc-ol7-chef_client_15-x86_64 is listed more than once in the 
configuration\

No package install available.\

Package edb-as13-server-13.13.19-1.el7.x86_64 already installed and latest 
version\

Package edb-as13-server-libs-13.13.19-1.el7.x86_64 already installed and latest 
version\

Package edb-as13-server-devel-13.13.19-1.el7.x86_64 already installed and 
latest version\

Nothing to do\

[root@hostip ~]#\

[root@hostip ~]# yum install -y gcc make wget epel-release freetds 
freetds-devel\

Loaded plugins: rhnplugin\

This system is not registered with Spacewalk server.\

You can use rhn_register to register.\

Spacewalk support will be disabled.\

Repository mc-ol7-base-x86_64 is listed more than once in the configuration\

Repository mc-ol7-layered-x86_64 is listed more than once in the configuration\

Repository mc-ol7_tsm-8.1.13_x86_64 is listed more than once in the 
configuration\

Repository mc-ol7-chef_client_15-x86_64 is listed more than once in the 
configuration\

Package gcc-4.8.5-44.0.3.el7.x86_64 already installed and latest version\

Package 1:make-3.82-24.el7.x86_64 already installed and latest version\

Package wget-1.14-18.el7_6.1.x86_64 already installed and latest version\

Package epel-release-7-14.noarch already installed and latest version\

Package freetds-1.3.3-1.el7.x86_64 already installed and latest version\

Package freetds-devel-1.3.3-1.el7.x86_64 already installed and latest version\

Nothing to do\

[root@hostip ~]#\

[root@hostip ~]# dnf install redhat-rpm-config\

-bash: dnf: command not found\

[root@hostip ~]#\

[root@hostip ~]# subscription-manager repos --enable 
rhel-7-server-optional-rpms \ --enable rhel-server-rhscl-7-rpms \ --enable 
rhel-7-server-devtools-rpms\

-bash: subscription-

Re: tds_fdw >> Install Foreign data Wrapper on EDB Postgres to connect to SQL server database

2024-05-29 Thread Sumit Kochar
Hi Muhammad,

Tried to install as per step2 mentioned, but got message - No package 
llvm-toolset-7 available.

Log reference below:

[root@hostip tds_fdw-2.0.3]# yum list installed | grep llvm-toolset
This system is not registered with Spacewalk server.
You can use rhn_register to register.
Spacewalk support will be disabled.
Repository mc-ol7-base-x86_64 is listed more than once in the configuration
Repository mc-ol7-layered-x86_64 is listed more than once in the configuration
Repository mc-ol7_tsm-8.1.13_x86_64 is listed more than once in the 
configuration
Repository mc-ol7-chef_client_15-x86_64 is listed more than once in the 
configuration
[root@hostip tds_fdw-2.0.3]#
[root@hostip tds_fdw-2.0.3]#
[root@hostip tds_fdw-2.0.3]# sudo yum install llvm-toolset-7
Loaded plugins: rhnplugin
This system is not registered with Spacewalk server.
You can use rhn_register to register.
Spacewalk support will be disabled.
Repository mc-ol7-base-x86_64 is listed more than once in the configuration
Repository mc-ol7-layered-x86_64 is listed more than once in the configuration
Repository mc-ol7_tsm-8.1.13_x86_64 is listed more than once in the 
configuration
Repository mc-ol7-chef_client_15-x86_64 is listed more than once in the 
configuration
No package llvm-toolset-7 available.
Error: Nothing to do
[root@hostip tds_fdw-2.0.3]#
[root@hostip tds_fdw-2.0.3]#

From: Muhammad Imtiaz 
Sent: Tuesday, May 28, 2024 11:43 PM
To: Ian Lawrence Barwick 
Cc: Sumit Kochar ; 
pgsql-general@lists.postgresql.org
Subject: {EXTERNAL} Re: tds_fdw >> Install Foreign data Wrapper on EDB Postgres 
to connect to SQL server database

Hi , You need to install the LLVM toolset. 1)Check that if it is installed or 
not : yum list installed | grep llvm-toolset 2)If it is not installed, you can 
install it using the following command. sudo yum install llvm-toolset-7 
Regards,Muhammad

Hi ,

You need to install the  LLVM toolset.

1)Check that if it is installed or not :

yum list installed | grep llvm-toolset



2)If it is not installed, you can install it using the following command.

sudo yum install llvm-toolset-7



Regards,

Muhammad Imtiaz







On Wed, 29 May 2024 at 05:27, Ian Lawrence Barwick 
mailto:barw...@gmail.com>> wrote:
2024年5月29日(水) 6:10 Sumit Kochar 
mailto:sumit.koc...@mastercard.com>>:
>
> Installation of Foreign data Wrapper on EDB Postgres to connect to SQL server 
> database is not working.
>
>
>
> https://github.com/tds-fdw/tds_fdw/issues/357<https://urldefense.com/v3/__https:/github.com/tds-fdw/tds_fdw/issues/357__;!!NDdRaFrjhKsg!t-kF9UHinbmu8b-lP0a7cxXvk9iocWrHWabJZytaRmbcLq4qaDB1zumrFBtMXnXur-vljJoQxz1eqIb5YfTO6y4$>
>
>
>
> Please advise if this has been encountered or a workaround is available.
(...)

> [root@hostip tds_fdw-2.0.3]# make USE_PGXS=1 install
>
> /opt/rh/llvm-toolset-7/root/usr/bin/clang -Wno-ignored-attributes 
> -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2  
> -I./include/ -fvisibility=hidden  -I. -I./ -I/usr/edb/as13/include/server 
> -I/usr/edb/as13/include/internal -I/usr/libexec/edb-icu66/include/ 
> -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include -flto=thin -emit-llvm -c 
> -o src/tds_fdw.bc src/tds_fdw.c
>
> make: /opt/rh/llvm-toolset-7/root/usr/bin/clang: Command not found

IIRC you'll need to find and install the SCLO package for Oracle Linux
7, assuming it's
available. For CentOS it's this repository:
http://mirror.centos.org/centos/7/sclo/<https://urldefense.com/v3/__http:/mirror.centos.org/centos/7/sclo/__;!!NDdRaFrjhKsg!t-kF9UHinbmu8b-lP0a7cxXvk9iocWrHWabJZytaRmbcLq4qaDB1zumrFBtMXnXur-vljJoQxz1eqIb5wnHkTo8$>
 .

Regards

Ian Barwick

CONFIDENTIALITY NOTICE This e-mail message and any attachments are only for the 
use of the intended recipient and may contain information that is privileged, 
confidential or exempt from disclosure under applicable law. If you are not the 
intended recipient, any disclosure, distribution or other use of this e-mail 
message or attachments is prohibited. If you have received this e-mail message 
in error, please delete and notify the sender immediately. Thank you.