Skip to main content

Module copy_data

Module copy_data 

Source
Expand description

Shared helpers for PostgreSQL COPY data blocks.

The parser emits a COPY statement’s data section (the lines between COPY ... FROM stdin; and the \. terminator) as a separate “Unknown” statement. Both validate and diff need to recognize such blocks and trim their leading whitespace; this module owns that logic so the two commands (and any future COPY consumer) cannot drift.

Functions§

is_copy_data_block
Returns true if stmt looks like a PostgreSQL COPY data block, i.e. it ends with the \. terminator line.
trim_copy_data
Trim leading whitespace/newlines from a COPY data block without copying.