podyn icon indicating copy to clipboard operation
podyn copied to clipboard

Generated COPY statements missing EOD marker

Open mfrederiksen-p44 opened this issue 6 years ago • 1 comments

For two empty tables the following SQL output is generated

COPY "TableFoo" FROM STDIN;
COPY "TableBar" FROM STDIN;
\.

resulting in error

psql:tdx-dev.sql:915: ERROR:  missing data for column "column1"
CONTEXT:  COPY TableFoo, line 1: "COPY "TableBar" FROM STDIN;"

because the first COPY statement is missing the EOD marker \.

mfrederiksen-p44 avatar Oct 18 '19 08:10 mfrederiksen-p44

Another example showing what appears to be interleaved statements:

data	ipsum	\N	\N	lorem
COPY "Table1" FROM STDIN;
COPY "Table2" FROM STDIN;
\.

COPY "Table3" FROM STDIN;
\.

COPY "Table4" FROM STDIN;
\.

\.

data	ipsum	\N	\N	lorem

mfrederiksen-p44 avatar Oct 18 '19 08:10 mfrederiksen-p44