head	1.2;
access;
symbols
	REL7_4_29:1.1
	REL7_4_28:1.1
	REL7_4_27:1.1
	REL7_4_26:1.1
	REL7_4_25:1.1
	REL7_4_24:1.1
	REL7_4_23:1.1
	REL7_4_22:1.1
	REL7_4_21:1.1
	REL7_4_20:1.1
	REL7_3_21:1.1
	REL7_4_19:1.1
	REL7_3_20:1.1
	REL7_4_18:1.1
	REL7_3_19:1.1
	REL7_4_17:1.1
	REL7_3_18:1.1
	REL7_4_16:1.1
	REL7_4_15:1.1
	REL7_3_17:1.1
	REL7_4_14:1.1
	REL7_3_16:1.1
	REL7_3_15:1.1
	REL7_4_13:1.1
	REL7_3_14:1.1
	REL7_4_12:1.1
	REL7_3_13:1.1
	REL7_4_11:1.1
	REL7_3_12:1.1
	REL7_4_10:1.1
	REL7_3_11:1.1
	REL7_4_9:1.1
	REL7_3_10:1.1
	REL7_4_8:1.1
	REL7_3_9:1.1
	REL7_4_7:1.1
	REL7_4_6:1.1
	REL7_3_8:1.1
	REL7_4_5:1.1
	REL7_3_7:1.1
	REL7_4_4:1.1
	REL7_4_3:1.1
	REL7_4_2:1.1
	REL7_3_6:1.1
	REL7_4_1:1.1
	REL7_3_5:1.1
	REL7_4:1.1
	REL7_4_RC2:1.1
	REL7_4_STABLE:1.1.0.6
	REL7_4_RC1:1.1
	REL7_4_BETA5:1.1
	REL7_4_BETA4:1.1
	REL7_4_BETA3:1.1
	REL7_4_BETA2:1.1
	WIN32_DEV:1.1.0.4
	REL7_4_BETA1:1.1
	REL7_3_4:1.1
	REL7_3_2:1.1
	REL7_3_STABLE:1.1.0.2;
locks; strict;
comment	@# @;


1.2
date	2004.03.07.02.27.00;	author joe;	state dead;
branches;
next	1.1;

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


desc
@@


1.2
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
@==================================================================
Name

*DEPRECATED* use new dblink syntax
dblink -- Returns a resource id for a data set from a remote database

Synopsis

dblink(text connstr, text sql)

Inputs

  connstr

    standard libpq format connection srting, 
    e.g. "hostaddr=127.0.0.1 port=5432 dbname=mydb user=postgres password=mypasswd"

  sql

    sql statement that you wish to execute on the remote host
    e.g. "select * from pg_class"

Outputs

  Returns setof int (res_id)

Example usage

  select dblink('hostaddr=127.0.0.1 port=5432 dbname=mydb user=postgres password=mypasswd'
               ,'select f1, f2 from mytable');

==================================================================

Name

*DEPRECATED* use new dblink syntax
dblink_tok -- Returns individual select field results from a dblink remote query

Synopsis

dblink_tok(int res_id, int fnumber)

Inputs

  res_id

    a resource id returned by a call to dblink()

  fnumber

    the ordinal position (zero based) of the field to be returned from the dblink result set

Outputs

  Returns text

Example usage

  select dblink_tok(t1.dblink_p,0) as f1, dblink_tok(t1.dblink_p,1) as f2
  from (select dblink('hostaddr=127.0.0.1 port=5432 dbname=mydb user=postgres password=mypasswd'
                     ,'select f1, f2 from mytable') as dblink_p) as t1;


==================================================================
*DEPRECATED* use new dblink syntax
A more convenient way to use dblink may be to create a view:

 create view myremotetable as
 select dblink_tok(t1.dblink_p,0) as f1, dblink_tok(t1.dblink_p,1) as f2
 from (select dblink('hostaddr=127.0.0.1 port=5432 dbname=template1 user=postgres password=postgres'
                    ,'select proname, prosrc from pg_proc') as dblink_p) as t1;

Then you can simply write:

   select f1, f2 from myremotetable where f1 like 'bytea%';

==================================================================
Name
*DEPRECATED* use new dblink_exec syntax
dblink_last_oid -- Returns last inserted oid

Synopsis

dblink_last_oid(int res_id) RETURNS oid

Inputs

  res_id

    any resource id returned by dblink function;

Outputs

  Returns oid of last inserted tuple

Example usage

test=# select dblink_last_oid(dblink('hostaddr=127.0.0.1 port=5432 dbname=mydb user=postgres password=mypasswd'
               ,'insert into mytable (f1, f2) values (1,2)'));

 dblink_last_oid
----------------
 16553
(1 row)

@


1.1
log
@Add missing dblink files.
@
text
@@

