Skip to main content

Module copy_to_insert

Module copy_to_insert 

Source
Expand description

Convert PostgreSQL COPY FROM stdin statements to INSERT statements.

Handles:

  • Tab-separated value parsing
  • NULL handling (\N → NULL)
  • Escape sequence conversion (\t, \n, \)
  • Batched INSERT generation for efficiency

Structs§

CopyHeader
Result of parsing a COPY header

Enums§

CopyValue
A parsed value from COPY data

Functions§

copy_to_inserts
Convert a COPY data block to INSERT statements
parse_copy_data
Parse COPY data block into rows of values
parse_copy_header
Parse a COPY header to extract table and columns Input: “COPY schema.table (col1, col2) FROM stdin;”