head	1.5;
access;
symbols
	REL7_4_29:1.2
	REL8_0_25:1.3
	REL8_1_21:1.3
	REL8_2_17:1.4
	REL7_4_28:1.2
	REL8_0_24:1.3
	REL8_1_20:1.3
	REL8_2_16:1.4
	REL7_4_27:1.2
	REL8_0_23:1.3
	REL8_1_19:1.3
	REL8_2_15:1.4
	REL7_4_26:1.2
	REL8_0_22:1.3
	REL8_1_18:1.3
	REL8_2_14:1.4
	REL7_4_25:1.2
	REL8_0_21:1.3
	REL8_1_17:1.3
	REL8_2_13:1.4
	REL7_4_24:1.2
	REL8_0_20:1.3
	REL8_1_16:1.3
	REL8_2_12:1.4
	REL7_4_23:1.2
	REL8_0_19:1.3
	REL8_1_15:1.3
	REL8_2_11:1.4
	REL7_4_22:1.2
	REL8_0_18:1.3
	REL8_1_14:1.3
	REL8_2_10:1.4
	REL7_4_21:1.2
	REL8_0_17:1.3
	REL8_1_13:1.3
	REL8_2_9:1.4
	REL7_4_20:1.2
	REL8_0_16:1.3
	REL8_1_12:1.3
	REL8_2_8:1.4
	REL8_2_7:1.4
	REL7_3_21:1.1
	REL7_4_19:1.2
	REL8_0_15:1.3
	REL8_1_11:1.3
	REL8_2_6:1.4
	REL8_3_BETA2:1.4
	REL8_3_BETA1:1.4
	REL7_3_20:1.1
	REL7_4_18:1.2
	REL8_0_14:1.3
	REL8_1_10:1.3
	REL8_2_5:1.4
	REL7_3_19:1.1
	REL7_4_17:1.2
	REL8_0_13:1.3
	REL8_1_9:1.3
	REL8_2_4:1.4
	REL8_0_12:1.3
	REL8_1_8:1.3
	REL8_2_3:1.4
	REL7_3_18:1.1
	REL7_4_16:1.2
	REL8_0_11:1.3
	REL8_1_7:1.3
	REL8_2_2:1.4
	REL8_0_10:1.3
	REL8_1_6:1.3
	REL8_2_1:1.4
	REL7_4_15:1.2
	REL7_3_17:1.1
	REL8_2_STABLE:1.4.0.2
	REL8_2_0:1.4
	REL8_2_RC1:1.4
	REL8_2_BETA3:1.4
	REL8_2_BETA2:1.4
	REL8_1_5:1.3
	REL8_0_9:1.3
	REL7_4_14:1.2
	REL7_3_16:1.1
	REL8_2_BETA1:1.4
	REL7_3_15:1.1
	REL7_4_13:1.2
	REL8_0_8:1.3
	REL8_1_4:1.3
	REL7_3_14:1.1
	REL7_4_12:1.2
	REL8_0_7:1.3
	REL8_1_3:1.3
	REL7_3_13:1.1
	REL7_4_11:1.2
	REL8_0_6:1.3
	REL8_1_2:1.3
	REL7_3_12:1.1
	REL7_4_10:1.2
	REL8_0_5:1.3
	REL8_1_1:1.3
	REL8_1_STABLE:1.3.0.6
	REL8_1_0:1.3
	REL8_1_0RC1:1.3
	REL8_1_0BETA4:1.3
	REL8_1_0BETA3:1.3
	REL7_3_11:1.1
	REL7_4_9:1.2
	REL8_0_4:1.3
	REL8_1_0BETA2:1.3
	REL8_1_0BETA1:1.3
	REL7_3_10:1.1
	REL7_4_8:1.2
	REL8_0_3:1.3
	REL8_0_2:1.3
	REL7_3_9:1.1
	REL7_4_7:1.2
	REL8_0_1:1.3
	REL8_0_STABLE:1.3.0.4
	REL8_0_0:1.3.0.2
	REL8_0_0RC5:1.3
	REL8_0_0RC4:1.3
	REL8_0_0RC3:1.3
	REL8_0_0RC2:1.3
	REL8_0_0RC1:1.3
	REL8_0_0BETA5:1.3
	REL8_0_0BETA4:1.3
	REL7_4_6:1.2
	REL7_3_8:1.1
	REL8_0_0BETA3:1.3
	REL8_0_0BETA2:1.3
	REL7_4_5:1.2
	REL7_3_7:1.1
	REL7_4_4:1.2
	REL8_0_0BETA1:1.3
	REL7_4_3:1.2
	REL7_4_2:1.2
	REL7_3_6:1.1
	REL7_4_1:1.2
	REL7_3_5:1.1
	REL7_4:1.2
	REL7_4_RC2:1.2
	REL7_4_STABLE:1.2.0.4
	REL7_4_RC1:1.2
	REL7_4_BETA5:1.2
	REL7_4_BETA4:1.2
	REL7_4_BETA3:1.2
	REL7_4_BETA2:1.2
	WIN32_DEV:1.2.0.2
	REL7_4_BETA1:1.2
	REL7_3_4:1.1
	REL7_3_2:1.1
	REL7_3_STABLE:1.1.0.2;
locks; strict;
comment	@# @;


1.5
date	2007.11.11.05.13.09;	author momjian;	state dead;
branches;
next	1.4;

1.4
date	2006.03.11.04.38.29;	author momjian;	state Exp;
branches;
next	1.3;

1.3
date	2004.03.07.02.27.00;	author joe;	state Exp;
branches;
next	1.2;

1.2
date	2003.06.25.01.10.15;	author momjian;	state Exp;
branches;
next	1.1;

1.1
date	2002.09.02.06.32.41;	author momjian;	state Exp;
branches;
next	;


desc
@@


1.5
log
@Remove /contrib/dblink/doc directory, now in SGML.
@
text
@$PostgreSQL: pgsql/contrib/dblink/doc/execute,v 1.4 2006/03/11 04:38:29 momjian Exp $
==================================================================
Name

dblink_exec -- Executes an UPDATE/INSERT/DELETE on a remote database

Synopsis

dblink_exec(text connstr, text sql [, bool fail_on_error])
dblink_exec(text connname, text sql [, bool fail_on_error])
dblink_exec(text sql [, bool fail_on_error])

Inputs

  connname
  connstr

    If two arguments are present, the first is first assumed to be a specific
    connection name to use. If the name is not found, the argument is then
    assumed to be a valid connection string, of standard libpq format,
    e.g.: "hostaddr=127.0.0.1 dbname=mydb user=postgres password=mypasswd"

    If only one argument is used, then the unnamed connection is used.

  sql

    sql statement that you wish to execute on the remote host, e.g.:
       insert into foo values(0,'a','{"a0","b0","c0"}');

  fail_on_error

    If true (default when not present) then an ERROR thrown on the remote side
    of the connection causes an ERROR to also be thrown locally. If false, the
    remote ERROR is locally treated as a NOTICE, and the return value is set
    to 'ERROR'.

Outputs

  Returns status of the command, or 'ERROR' if the command failed.

Notes
  1) dblink_open starts an explicit transaction. If, after using dblink_open,
     you use dblink_exec to change data, and then an error occurs or you use
     dblink_disconnect without a dblink_close first, your change *will* be
     lost.

Example usage

select dblink_connect('dbname=dblink_test_slave');
 dblink_connect
----------------
 OK
(1 row)

select dblink_exec('insert into foo values(21,''z'',''{"a0","b0","c0"}'');');
   dblink_exec
-----------------
 INSERT 943366 1
(1 row)

select dblink_connect('myconn','dbname=regression');
 dblink_connect
----------------
 OK
(1 row)

select dblink_exec('myconn','insert into foo values(21,''z'',''{"a0","b0","c0"}'');');
   dblink_exec
------------------
 INSERT 6432584 1
(1 row)

select dblink_exec('myconn','insert into pg_class values (''foo'')',false);
NOTICE:  sql error
DETAIL:  ERROR:  null value in column "relnamespace" violates not-null constraint

 dblink_exec
-------------
 ERROR
(1 row)
@


1.4
log
@Add CVS tag lines to files that were lacking them.
@
text
@d1 1
a1 1
$PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.314 2006/03/07 02:54:23 momjian Exp $
@


1.3
log
@Added new versions of dblink, dblink_exec, dblink_open, dblink_close,
and, dblink_fetch -- allows ERROR on remote side of connection to
throw NOTICE locally instead of ERROR. Also removed documentation for
previously deprecated, now removed, functions.
@
text
@d1 1
@


1.2
log
@Please apply attached patch to contrib/dblink. It adds named persistent
connections to dblink.

Shridhar Daithanka
@
text
@d8 3
a10 3
dblink_exec(text connstr, text sql)
dblink_exec(text connname, text sql)
dblink_exec(text sql)
d16 1
d29 7
d38 1
a38 1
  Returns status of the command
d70 9
@


1.1
log
@Add missing dblink files.
@
text
@d9 1
a9 1
- or -
d14 1
d16 4
d21 1
a21 4
    standard libpq format connection string, 
    e.g. "hostaddr=127.0.0.1 port=5432 dbname=mydb user=postgres password=mypasswd"
    If the second form is used, then the dblink_connect(text connstr) must be
    executed first.
a25 1

d40 1
a40 1
test=# select dblink_connect('dbname=dblink_test_slave');
d46 1
a46 1
test=# select dblink_exec('insert into foo values(21,''z'',''{"a0","b0","c0"}'');');
d50 12
@

