Skip to main content
Ctrl+K

Tantor Basic Edition 16.8 documentation

Table of contents:

  • Preface
    • 1.  What Is Tantor BE?
    • 2. A Brief History of PostgreSQL
    • 3. What are the differences between Tantor BE 16 and PostgreSQL 16
    • 4. Conventions
    • 5. Bug Reporting Guidelines
  • Part I. Tutorial
    • Chapter 1. Synopsis
    • Chapter 2. The SQL Language
    • Chapter 3. Advanced Features
  • Part II. The SQL Language
    • Chapter 4. SQL Syntax
    • Chapter 5. Data Definition
    • Chapter 6. Data Manipulation
    • Chapter 7. Queries
    • Chapter 8. Data Types
    • Chapter 9. Functions and Operators
    • Chapter 10. Type Conversion
    • Chapter 11. Indexes
    • Chapter 12. Full Text Search
    • Chapter 13. Concurrency Control
    • Chapter 14. Performance Tips
    • Chapter 15. Parallel Query
  • Part III. Server Administration
    • Chapter 16. Installation from Binaries
    • Chapter 17. Server Setup and Operation
    • Chapter 18. Server Configuration
    • Chapter 19. Client Authentication
    • Chapter 20. Database Roles
    • Chapter 21. Managing Databases
    • Chapter 22. Localization
    • Chapter 23. Routine Database Maintenance Tasks
    • Chapter 24. Backup and Restore
    • Chapter 25. High Availability, Load Balancing, and Replication
    • Chapter 26. Monitoring Database Activity
    • Chapter 27. Monitoring Disk Usage
    • Chapter 28. Reliability and the Write-Ahead Log
    • Chapter 29. Logical Replication
    • Chapter 30. Just-in-Time Compilation (JIT)
  • Part IV. Client Interfaces
    • Chapter 31. libpq — C Library
    • Chapter 32. Large Objects
    • Chapter 33. ECPG — Embedded SQL in C
    • Chapter 34. The Information Schema
  • Part V. Server Programming
    • Chapter 35. Extending SQL
    • Chapter 36. Triggers
    • Chapter 37. Event Triggers
    • Chapter 38. The Rule System
    • Chapter 39. Procedural Languages
    • Chapter 40. PL/pgSQL — SQL Procedural Language
    • Chapter 41. PL/Tcl — Tcl Procedural Language
    • Chapter 42. PL/Perl — Perl Procedural Language
    • Chapter 43. PL/Python — Python Procedural Language
    • Chapter 44. Server Programming Interface
    • Chapter 45. Background Worker Processes
    • Chapter 46. Logical Decoding
    • Chapter 47. Replication Progress Tracking
    • Chapter 48. Archive Modules
  • Part VI. Reference
    • SQL Commands
    • PostgreSQL Client Applications
    • PostgreSQL Server Applications
  • Part VII. Internals
    • Chapter 49. Overview of PostgreSQL Internals
    • Chapter 50. System Catalogs
    • Chapter 51. System Views
    • Chapter 52. Frontend/Backend Protocol
    • Chapter 53. PostgreSQL Coding Conventions
    • Chapter 54. Native Language Support
    • Chapter 55. Writing a Procedural Language Handler
    • Chapter 56. Writing a Foreign Data Wrapper
    • Chapter 57. Writing a Table Sampling Method
    • Chapter 58. Writing a Custom Scan Provider
    • Chapter 59. Genetic Query Optimizer
    • Chapter 60. Table Access Method Interface Definition
    • Chapter 61. Index Access Method Interface Definition
    • Chapter 62. Generic WAL Records
    • Chapter 63. Custom WAL Resource Managers
    • Chapter 64. B-Tree Indexes
    • Chapter 65. GiST Indexes
    • Chapter 66. SP-GiST Indexes
    • Chapter 67. GIN Indexes
    • Chapter 68. BRIN Indexes
    • Chapter 69. Hash Indexes
    • Chapter 70. Database Physical Storage
    • Chapter 71. Transaction Processing
    • Chapter 72. System Catalog Declarations and Initial Contents
    • Chapter 73. How the Planner Uses Statistics
    • Chapter 74. Backup Manifest Format
  • Part VIII. Appendixes
    • Appendix A. Tantor BE Error Codes
    • Appendix B. Date/Time Support
    • Appendix C. SQL Key Words
    • Appendix D. SQL Conformance
    • Appendix E. Release Notes
    • Appendix F. Additional Supplied Modules and Extensions
    • Appendix G. Additional Supplied Programs
    • Appendix H. Additional External Modules
    • Appendix I. External Projects
    • Appendix J. Tantor BE Limits
    • Appendix K. Acronyms
    • Appendix L. Glossary
    • Appendix M. Color Support
    • Appendix N. Obsolete or Renamed Features
  • Bibliography
  • Index

dblink_fetch

dblink_fetch#

dblink_fetch
dblink_fetch
Prev UpF.13. dblink — connect to other PostgreSQL databasesHome Next

dblink_fetch

dblink_fetch — returns rows from an open cursor in a remote database

Synopsis

dblink_fetch(text cursorname, int howmany [, bool fail_on_error]) returns setof record
dblink_fetch(text connname, text cursorname, int howmany [, bool fail_on_error]) returns setof record

Description

dblink_fetch fetches rows from a cursor previously established by dblink_open.

Arguments

connname

Name of the connection to use; omit this parameter to use the unnamed connection.

cursorname

The name of the cursor to fetch from.

howmany

The maximum number of rows to retrieve. The next howmany rows are fetched, starting at the current cursor position, moving forward. Once the cursor has reached its end, no more rows are produced.

fail_on_error

If true (the default when omitted) 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 reported as a NOTICE, and the function returns no rows.

Return Value

The function returns the row(s) fetched from the cursor. To use this function, you will need to specify the expected set of columns, as previously discussed for dblink.

Notes

On a mismatch between the number of return columns specified in the FROM clause, and the actual number of columns returned by the remote cursor, an error will be thrown. In this event, the remote cursor is still advanced by as many rows as it would have been if the error had not occurred. The same is true for any other error occurring in the local query after the remote FETCH has been done.

Examples

SELECT dblink_connect('dbname=postgres options=-csearch_path=');
 dblink_connect
----------------
 OK
(1 row)

SELECT dblink_open('foo', 'select proname, prosrc from pg_proc where proname like ''bytea%''');
 dblink_open
-------------
 OK
(1 row)

SELECT * FROM dblink_fetch('foo', 5) AS (funcname name, source text);
 funcname |  source
----------+----------
 byteacat | byteacat
 byteacmp | byteacmp
 byteaeq  | byteaeq
 byteage  | byteage
 byteagt  | byteagt
(5 rows)

SELECT * FROM dblink_fetch('foo', 5) AS (funcname name, source text);
 funcname  |  source
-----------+-----------
 byteain   | byteain
 byteale   | byteale
 bytealike | bytealike
 bytealt   | bytealt
 byteane   | byteane
(5 rows)

SELECT * FROM dblink_fetch('foo', 5) AS (funcname name, source text);
  funcname  |   source
------------+------------
 byteanlike | byteanlike
 byteaout   | byteaout
(2 rows)

SELECT * FROM dblink_fetch('foo', 5) AS (funcname name, source text);
 funcname | source
----------+--------
(0 rows)

Prev Up Next
dblink_open Home dblink_close
Commercial use is possible only with written permission from the company LLC “Tantor Labs”
© LLC "Tantor Labs"
  • Technical Support Policy
  • Cookie Processing Policy
  • Website User Agreement
Products
  • Tantor DBMS
  • Tantor Platform
  • Documentation
Contacts
  • +7 495 369-48-16
  • info@tantorlabs.ru
16.8.1 - 8e8befb1 - 2025-04-10 15:44:23