You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-9Lines changed: 32 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,31 +87,54 @@ You can install `DBLINK()` from the latest released binaries without needing to
87
87
88
88
### Installing pre-built binaries
89
89
90
-
1. Download the appropriate build of ldblink.so from the [latest release](https://github.com/vertica/dblink/releases) to `ldblink.so`.
91
-
2. Copy `ldblink.so` to the initiator node.
92
-
3. Execute this SQL substituting the full path of ldblink.so on the initiator node:
90
+
1. Download the appropriate build of ldblink.so from the [latest release](https://github.com/vertica/dblink/releases).
91
+
Example:
92
+
ldblink.so.centos-v23.3.0 -> binary for vertica v23.3.0 on CentOS
93
+
2. Rename the binary to `ldblink.so`
94
+
3. Copy `ldblink.so` to the initiator node.
95
+
4. Execute this SQL substituting the full path of ldblink.so on the initiator node:
93
96
```sql
94
97
CREATE OR REPLACE LIBRARY DBLink AS '/full/path/to/ldblink.so' LANGUAGE 'C++';
95
98
CREATE OR REPLACE TRANSFORM FUNCTION dblink AS LANGUAGE 'C++' NAME 'DBLinkFactory' LIBRARY DBLink ;
96
99
GRANT EXECUTE ON TRANSFORM FUNCTION dblink() TO PUBLIC ;
97
100
```
98
-
4. (optional) Delete ldblink.so from initiator node.
101
+
5. Create a [Connection Identifier Database](#connection-identifier-database) (a simple text file) under `/usr/local/etc/dblink.cids`. You can use a different location by changing the `DBLINK_CIDS` define in the source code.
102
+
For details, see [Configure DBLINK()](#configure-dblink).
103
+
104
+
6. (optional) Delete ldblink.so from initiator node.
99
105
100
106
### Build DBLINK() From Source
101
107
102
108
Before you run `make` commands, review the [Makefile](Makefile) and make any necessary changes.
103
109
110
+
#### On your own build environment
111
+
112
+
- First you need to [Setup a C++ Development Environment](https://docs.vertica.com/23.3.x/en/extending/developing-udxs/developing-with-sdk/cpp-sdk/setting-up-cpp-sdk/)
113
+
- Then to build using the installed Vertica SDK and devtoolset (centos): just run
114
+
> ```make```
115
+
- Install the library in Vertica (as dbadmin):
116
+
>```make install```
117
+
- Create a [Connection Identifier Database](#connection-identifier-database) (a simple text file) under `/usr/local/etc/dblink.cids`. You can use a different location by changing the `DBLINK_CIDS` define in the source code.
118
+
For details, see [Configure DBLINK()](#configure-dblink).
119
+
120
+
#### Without setting up a build environment
121
+
122
+
This is mainly for <b>testing</b> and <b>release</b>, or when you want to build dblink for a specific vertica version on centos/ubuntu but you do not have the tools to do it. It uses the [verticasdk](https://hub.docker.com/r/vertica/verticasdk) docker image owned by Vertica to build dblink for any specified vertica version.
104
123
1. Compile the DBLINK source code with for the appropriate Vertica version and Linux distribution.
105
-
- To build using the installed Vertica SDK and devtoolset (centos), just run `make`
106
124
- To build without needing to set up a build environment, specify the version and target OS. For example:
107
-
> ```$ make VERTICA_VERSION=12.0.2 OSTAG=ubuntu```
108
-
2. Follow the install proceedures above or use the `install` makefile target to deploy the library in Vertica as dbadmin:
109
-
> ```$ make install```.
125
+
```
126
+
$ make -C docker-dblink VERTICA_VERSION=12.0.2 OSTAG=ubuntu
127
+
```
128
+
it will create `ldblink.s0.ubuntu-v12.0.2` in the docker-dblink directory
129
+
130
+
2. Install the library in Vertica (as dbadmin):
131
+
Follow [Installing pre-built libraries](#installing-pre-built-binaries) from step 2.
132
+
110
133
3. Create a [Connection Identifier Database](#connection-identifier-database) (a simple text file) under `/usr/local/etc/dblink.cids`. You can use a different location by changing the `DBLINK_CIDS` define in the source code.
111
134
For details, see [Configure DBLINK()](#configure-dblink).
112
135
113
136
### Uninstall DBLINK()
114
-
You can uninstall the library with `DROP LIBRARAY DBLink` in vsql or by running `make clean`.
137
+
You can uninstall the library with `DROP LIBRARY DBLink` in vsql or by running `make clean`.
0 commit comments