Docs

postgres/replace.sql

replace.sql — truncate history then re-insert full staging set (no versioning)

replace.sql — truncate history then re-insert full staging set (no versioning)

Context fields  

  • .HistorySchema
  • .HistoryTable
  • .StagingSchema
  • .StagingTable

Template  

{{- /* replace.sql — truncate history then re-insert full staging set (no versioning) */ -}}
TRUNCATE "{{ .HistorySchema }}"."{{ .HistoryTable }}";

INSERT INTO "{{ .HistorySchema }}"."{{ .HistoryTable }}" (
    {{ template "business_col_list" . }}, {{ template "amf_system_cols" . }}
)
SELECT {{ template "business_col_list" . }}, {{ template "amf_system_vals" . }}
FROM   "{{ .StagingSchema }}"."{{ .StagingTable }}" stg

Provenance  

Platformpostgres
Filepostgres/replace.sql
Versionv1.3.1
Lines8
SHA-256521202134628c11287e7bb0108fbc3f711e4d58426f616753f01bb9a5da6f182

Last updated on October 11, 2026