diff --git a/gpdb-doc/dita/utility_guide/dblink.xml b/gpdb-doc/dita/utility_guide/dblink.xml index a340df06980b926b0ac24e497fe176758f4d36e4..d09cdee4097baa259cfc8e891a58f3b812b28fc8 100644 --- a/gpdb-doc/dita/utility_guide/dblink.xml +++ b/gpdb-doc/dita/utility_guide/dblink.xml @@ -2,17 +2,22 @@ dblink Functions - The dblink module is provided for making easy connections to other - databases either on the same database host, or on a remote host. + The dblink module supports connections to other Greenplum + Database databases from within a database session. These databases may reside on the + same database host, or on a remote host. +

Greenplum Database supports dblink connections between databases + in Greenplum Database installations with the same major version number. + dblink may also connect to other Greenplum Database + installations that use compatible libpq libraries.

dblink is intended for database users to perform short ad hoc queries in - other databases. dblink is not intended as a replacement for external tables - or for administrative tools such as gptransfer.

-

The following procedure shows the basic steps for configuring and using - dblink in Greenplum Database. See dblink is not intended for use as a replacement for external + tables or for administrative tools such as gptransfer.

+

The following procedure identifies the basic steps for configuring and using + dblink in Greenplum Database. Refer to dblink in the PostgreSQL documentation for more information about individual - functions.

+ dblink functions.

You must specify both a hostname and a password to connect with dblink as a non-superuser.
    @@ -39,7 +44,7 @@ postgres=# \q psql (8.3.23) Type "help" for help. -gpadmin=# \i /usr/local/gpdb/share/postgresql/contrib/dblink.sql +gpadmin=# \i /usr/local/greenplum-db/share/postgresql/contrib/dblink.sql SET CREATE FUNCTION CREATE FUNCTION @@ -50,7 +55,7 @@ REVOKE CREATE FUNCTION CREATE FUNCTION ... -
  1. Use the dblink_connect function to create both implicit and named +
  2. Use the dblink_connect() function to create both implicit and named connections to other databases. The connection string that you provide should be a libpq-style keyword/value string. For example, to create a named connection to the postgres database on the local Greenplum Database @@ -65,9 +70,9 @@ CREATE FUNCTION system:gpadmin=# SELECT dblink_connect('host=remotehost port=5432 dbname=postgres');

    You must specify both a hostname and a password in the connection string to connect as a non-superuser.
  3. -
  4. Use the basic dblink function to query a database using a configured - connection. Keep in mind that the dblink function returns a record type, so - you must assign the columns returned in the dblink query. For example, the +
  5. Use the basic dblink() function to query a database using a configured + connection. Keep in mind that this function returns a record type, so + you must assign the columns returned in the dblink() query. For example, the following command uses the named connection to query the table you created in Step 1:gpadmin=# SELECT * FROM dblink('mylocalconn', 'SELECT * FROM testdblink') AS dbltab(id int, product text); id | product @@ -77,7 +82,7 @@ CREATE FUNCTION (2 rows)

    In this release of Greenplum Database, statements that modify table data cannot use named or implicit dblink connections. Instead, you must provide the connection - string directly in the dblink function. For + string directly in the dblink() function. For example:gpadmin=# CREATE TABLE testdbllocal (a int, b text) DISTRIBUTED BY (a); CREATE TABLE gpadmin=# INSERT INTO testdbllocal select * FROM dblink('dbname=postgres', 'SELECT * FROM testdblink') AS dbltab(id int, product text);