RefLib

Reference library for AI

Back

postgresql_16:9.6.12.19.1 Description

PostgreSQL 16 > Appendixes > Additional Supplied Modules and Extensions > dblink — connect to other PostgreSQL databases > dblink_build_sql_update > Description

dblink_build_sql_update 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 UPDATE 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.) The UPDATE command always assigns all fields of the row — the main difference between this and dblink_build_sql_insert is that it's assumed that the target row already exists in the remote table.

Back