Skip to main content
Ctrl+K

Tantor BE 15.12 Документация

EN RU

Оглавление:

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

dblink_build_sql_insert

dblink_build_sql_insert#

dblink_build_sql_insert
dblink_build_sql_insert
Назад НаверхF.14. dblinkНачало Далее

dblink_build_sql_insert

dblink_build_sql_insert — builds an INSERT statement using a local tuple, replacing the primary key field values with alternative supplied values

Синтаксис

dblink_build_sql_insert(text relname,
                        int2vector primary_key_attnums,
                        integer num_primary_key_atts,
                        text[] src_pk_att_vals_array,
                        text[] tgt_pk_att_vals_array) returns text

Description

dblink_build_sql_insert can be useful in doing selective replication of a local table to a remote database. It selects a row from the local table based on primary key, and then builds an SQL INSERT command that will duplicate that row, but with the primary key values replaced by the values in the last argument. (To make an exact copy of the row, just specify the same values for the last two arguments.)

Arguments

relname

Name of a local relation, for example foo or myschema.mytab. Include double quotes if the name is mixed-case or contains special characters, for example "FooBar"; without quotes, the string will be folded to lower case.

primary_key_attnums

Attribute numbers (1-based) of the primary key fields, for example 1 2.

num_primary_key_atts

The number of primary key fields.

src_pk_att_vals_array

Values of the primary key fields to be used to look up the local tuple. Each field is represented in text form. An error is thrown if there is no local row with these primary key values.

tgt_pk_att_vals_array

Values of the primary key fields to be placed in the resulting INSERT command. Each field is represented in text form.

Return Value

Returns the requested SQL statement as text.

Notes

As of PostgreSQL 9.0, the attribute numbers in primary_key_attnums are interpreted as logical column numbers, corresponding to the column's position in SELECT * FROM relname. Previous versions interpreted the numbers as physical column positions. There is a difference if any column(s) to the left of the indicated column have been dropped during the lifetime of the table.

Examples

SELECT dblink_build_sql_insert('foo', '1 2', 2, '{"1", "a"}', '{"1", "b''a"}');
             dblink_build_sql_insert
--------------------------------------------------
 INSERT INTO foo(f1,f2,f3) VALUES('1','b''a','1')
(1 row)

Назад Наверх Далее
dblink_get_pkey Начало dblink_build_sql_delete
Коммерческое использование возможно только с письменного разрешения компании ОOO “Лаборатории Тантор”
© ООО "Лаборатории Тантор"
  • Положение о технической поддержке
  • Политика обработки файлов сookie
  • Пользовательское соглашение сайта
Продукты
  • СУБД Tantor
  • Платформа Tantor
  • Документация
Контакты
  • +7 495 369-48-16
  • info@tantorlabs.ru
15.12.0 - 77d56436 - 2025-07-18 14:30:18