|
1 |
| -<!-- $PostgreSQL: pgsql/doc/src/sgml/dblink.sgml,v 1.12 2010/06/07 02:01:08 itagaki Exp $ --> |
| 1 | +<!-- $PostgreSQL: pgsql/doc/src/sgml/dblink.sgml,v 1.13 2010/06/15 20:29:01 tgl Exp $ --> |
2 | 2 |
|
3 | 3 | <sect1 id="dblink">
|
4 | 4 | <title>dblink</title>
|
@@ -1294,9 +1294,9 @@ SELECT *
|
1294 | 1294 | <title>Description</title>
|
1295 | 1295 |
|
1296 | 1296 | <para>
|
1297 |
| - <function>dblink_get_notify</> retrieves notifications on either |
| 1297 | + <function>dblink_get_notify</> retrieves notifications on either |
1298 | 1298 | the unnamed connection, or on a named connection if specified.
|
1299 |
| - To receive notifications via dblink, <function>LISTEN</> must |
| 1299 | + To receive notifications via dblink, <function>LISTEN</> must |
1300 | 1300 | first be issued, using <function>dblink_exec</>.
|
1301 | 1301 | For details see <xref linkend="sql-listen"> and <xref linkend="sql-notify">.
|
1302 | 1302 | </para>
|
@@ -1620,6 +1620,10 @@ SELECT * FROM dblink_get_notify();
|
1620 | 1620 | <programlisting>
|
1621 | 1621 | CREATE TYPE dblink_pkey_results AS (position int, colname text);
|
1622 | 1622 | </programlisting>
|
| 1623 | + |
| 1624 | + The <literal>position</> column simply runs from 1 to <replaceable>N</>; |
| 1625 | + it is the number of the field within the primary key, not the number |
| 1626 | + within the table's columns. |
1623 | 1627 | </para>
|
1624 | 1628 | </refsect1>
|
1625 | 1629 |
|
@@ -1659,7 +1663,7 @@ test=# select * from dblink_get_pkey('foobar');
|
1659 | 1663 | <synopsis>
|
1660 | 1664 | dblink_build_sql_insert(text relname,
|
1661 | 1665 | int2vector primary_key_attnums,
|
1662 |
| - int2 num_primary_key_atts, |
| 1666 | + integer num_primary_key_atts, |
1663 | 1667 | text[] src_pk_att_vals_array,
|
1664 | 1668 | text[] tgt_pk_att_vals_array) returns text
|
1665 | 1669 | </synopsis>
|
@@ -1745,6 +1749,20 @@ test=# select * from dblink_get_pkey('foobar');
|
1745 | 1749 | <para>Returns the requested SQL statement as text.</para>
|
1746 | 1750 | </refsect1>
|
1747 | 1751 |
|
| 1752 | + <refsect1> |
| 1753 | + <title>Notes</title> |
| 1754 | + |
| 1755 | + <para> |
| 1756 | + As of <productname>PostgreSQL</> 9.0, the attribute numbers in |
| 1757 | + <parameter>primary_key_attnums</parameter> are interpreted as logical |
| 1758 | + column numbers, corresponding to the column's position in |
| 1759 | + <literal>SELECT * FROM relname</>. Previous versions interpreted the |
| 1760 | + numbers as physical column positions. There is a difference if any |
| 1761 | + column(s) to the left of the indicated column have been dropped during |
| 1762 | + the lifetime of the table. |
| 1763 | + </para> |
| 1764 | + </refsect1> |
| 1765 | + |
1748 | 1766 | <refsect1>
|
1749 | 1767 | <title>Example</title>
|
1750 | 1768 |
|
@@ -1775,7 +1793,7 @@ test=# select * from dblink_get_pkey('foobar');
|
1775 | 1793 | <synopsis>
|
1776 | 1794 | dblink_build_sql_delete(text relname,
|
1777 | 1795 | int2vector primary_key_attnums,
|
1778 |
| - int2 num_primary_key_atts, |
| 1796 | + integer num_primary_key_atts, |
1779 | 1797 | text[] tgt_pk_att_vals_array) returns text
|
1780 | 1798 | </synopsis>
|
1781 | 1799 | </refsynopsisdiv>
|
@@ -1845,6 +1863,20 @@ test=# select * from dblink_get_pkey('foobar');
|
1845 | 1863 | <para>Returns the requested SQL statement as text.</para>
|
1846 | 1864 | </refsect1>
|
1847 | 1865 |
|
| 1866 | + <refsect1> |
| 1867 | + <title>Notes</title> |
| 1868 | + |
| 1869 | + <para> |
| 1870 | + As of <productname>PostgreSQL</> 9.0, the attribute numbers in |
| 1871 | + <parameter>primary_key_attnums</parameter> are interpreted as logical |
| 1872 | + column numbers, corresponding to the column's position in |
| 1873 | + <literal>SELECT * FROM relname</>. Previous versions interpreted the |
| 1874 | + numbers as physical column positions. There is a difference if any |
| 1875 | + column(s) to the left of the indicated column have been dropped during |
| 1876 | + the lifetime of the table. |
| 1877 | + </para> |
| 1878 | + </refsect1> |
| 1879 | + |
1848 | 1880 | <refsect1>
|
1849 | 1881 | <title>Example</title>
|
1850 | 1882 |
|
@@ -1875,7 +1907,7 @@ test=# select * from dblink_get_pkey('foobar');
|
1875 | 1907 | <synopsis>
|
1876 | 1908 | dblink_build_sql_update(text relname,
|
1877 | 1909 | int2vector primary_key_attnums,
|
1878 |
| - int2 num_primary_key_atts, |
| 1910 | + integer num_primary_key_atts, |
1879 | 1911 | text[] src_pk_att_vals_array,
|
1880 | 1912 | text[] tgt_pk_att_vals_array) returns text
|
1881 | 1913 | </synopsis>
|
@@ -1964,6 +1996,20 @@ test=# select * from dblink_get_pkey('foobar');
|
1964 | 1996 | <para>Returns the requested SQL statement as text.</para>
|
1965 | 1997 | </refsect1>
|
1966 | 1998 |
|
| 1999 | + <refsect1> |
| 2000 | + <title>Notes</title> |
| 2001 | + |
| 2002 | + <para> |
| 2003 | + As of <productname>PostgreSQL</> 9.0, the attribute numbers in |
| 2004 | + <parameter>primary_key_attnums</parameter> are interpreted as logical |
| 2005 | + column numbers, corresponding to the column's position in |
| 2006 | + <literal>SELECT * FROM relname</>. Previous versions interpreted the |
| 2007 | + numbers as physical column positions. There is a difference if any |
| 2008 | + column(s) to the left of the indicated column have been dropped during |
| 2009 | + the lifetime of the table. |
| 2010 | + </para> |
| 2011 | + </refsect1> |
| 2012 | + |
1967 | 2013 | <refsect1>
|
1968 | 2014 | <title>Example</title>
|
1969 | 2015 |
|
|
0 commit comments