MCPcopy Create free account
hub / github.com/apecloud/myduckserver / truncate

Method truncate

pgserver/logrepl/replication.go:1108–1117  ·  view source on GitHub ↗
(state *replicationState, relationID uint32)

Source from the content-addressed store, hash-verified

1106}
1107
1108func (r *LogicalReplicator) truncate(state *replicationState, relationID uint32) error {
1109 rel, ok := state.relations[relationID]
1110 if !ok {
1111 return fmt.Errorf("unknown relation ID %d", relationID)
1112 }
1113
1114 r.logger.Debugf("Truncating table %s.%s\n", rel.Namespace, rel.RelationName)
1115 _, err := adapter.ExecInTxn(state.replicaCtx, `TRUNCATE `+catalog.ConnectIdentifiersANSI(rel.Namespace, rel.RelationName))
1116 return err
1117}
1118
1119func tupleDataFormat(dataType uint8) int16 {
1120 switch dataType {

Callers 1

processMessageMethod · 0.95

Calls 2

ExecInTxnFunction · 0.92
ConnectIdentifiersANSIFunction · 0.92

Tested by

no test coverage detected