Skip to main content
Ctrl+K

Tantor Special Edition 16.8 documentation

Table of contents:

  • Preface
    • 1.  What Is Tantor SE?
    • 2. A Brief History of PostgreSQL
    • 3. What are the differences between Tantor SE 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
    • Chapter 16. Autonomous Transactions
  • Part III. Server Administration
    • Chapter 17. Installation from Binaries
    • Chapter 18. Server Setup and Operation
    • Chapter 19. Server Configuration
    • Chapter 20. Client Authentication
    • Chapter 21. Database Roles
    • Chapter 22. Managing Databases
    • Chapter 23. Localization
    • Chapter 24. Routine Database Maintenance Tasks
    • Chapter 25. Backup and Restore
    • Chapter 26. High Availability, Load Balancing, and Replication
    • Chapter 27. Monitoring Database Activity
    • Chapter 28. Monitoring Disk Usage
    • Chapter 29. Reliability and the Write-Ahead Log
    • Chapter 30. Logical Replication
    • Chapter 31. Just-in-Time Compilation (JIT)
  • Part IV. Client Interfaces
    • Chapter 32. libpq — C Library
    • Chapter 33. Large Objects
    • Chapter 34. ECPG — Embedded SQL in C
    • Chapter 35. The Information Schema
  • Part V. Server Programming
    • Chapter 36. Extending SQL
    • Chapter 37. Triggers
    • Chapter 38. Event Triggers
    • Chapter 39. The Rule System
    • Chapter 40. Procedural Languages
    • Chapter 41. PL/pgSQL — SQL Procedural Language
    • Chapter 42. PL/Tcl — Tcl Procedural Language
    • Chapter 43. PL/Perl — Perl Procedural Language
    • Chapter 44. PL/Python — Python Procedural Language
    • Chapter 45. Server Programming Interface
    • Chapter 46. Background Worker Processes
    • Chapter 47. Logical Decoding
    • Chapter 48. Replication Progress Tracking
    • Chapter 49. Archive Modules
  • Part VI. Reference
    • SQL Commands
    • PostgreSQL Client Applications
    • PostgreSQL Server Applications
  • Part VII. Internals
    • Chapter 50. Overview of PostgreSQL Internals
    • Chapter 51. System Catalogs
    • Chapter 52. System Views
    • Chapter 53. Frontend/Backend Protocol
    • Chapter 54. PostgreSQL Coding Conventions
    • Chapter 55. Native Language Support
    • Chapter 56. Writing a Procedural Language Handler
    • Chapter 57. Writing a Foreign Data Wrapper
    • Chapter 58. Writing a Table Sampling Method
    • Chapter 59. Writing a Custom Scan Provider
    • Chapter 60. Genetic Query Optimizer
    • Chapter 61. Table Access Method Interface Definition
    • Chapter 62. Index Access Method Interface Definition
    • Chapter 63. Generic WAL Records
    • Chapter 64. Custom WAL Resource Managers
    • Chapter 65. B-Tree Indexes
    • Chapter 66. GiST Indexes
    • Chapter 67. SP-GiST Indexes
    • Chapter 68. GIN Indexes
    • Chapter 69. BRIN Indexes
    • Chapter 70. Hash Indexes
    • Chapter 71. Database Physical Storage
    • Chapter 72. Transaction Processing
    • Chapter 73. System Catalog Declarations and Initial Contents
    • Chapter 74. How the Planner Uses Statistics
    • Chapter 75. Backup Manifest Format
  • Part VIII. Appendixes
    • Appendix A. Tantor SE 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 SE Limits
    • Appendix K. Acronyms
    • Appendix L. Glossary
    • Appendix M. Color Support
    • Appendix N. Obsolete or Renamed Features
  • Bibliography
  • Index

dblink_build_sql_delete

dblink_build_sql_delete#

dblink_build_sql_delete
dblink_build_sql_delete
Prev UpF.14. dblink — connect to other PostgreSQL databasesHome Next

dblink_build_sql_delete

dblink_build_sql_delete — builds a DELETE statement using supplied values for primary key field values

Synopsis

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

Description

dblink_build_sql_delete can be useful in doing selective replication of a local table to a remote database. It builds an SQL DELETE command that will delete the row with the given primary key values.

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.

tgt_pk_att_vals_array

Values of the primary key fields to be used in the resulting DELETE 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_delete('"MyFoo"', '1 2', 2, '{"1", "b"}');
           dblink_build_sql_delete
---------------------------------------------
 DELETE FROM "MyFoo" WHERE f1='1' AND f2='b'
(1 row)

Prev Up Next
dblink_build_sql_insert Home dblink_build_sql_update
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:46:39