citusdata / podyn

DynamoDB to PostgreSQL & Citus continuous replication tool
Apache License 2.0
85 stars 30 forks source link

Generated COPY statements missing EOD marker #12

Open mfrederiksen-p44 opened 4 years ago

mfrederiksen-p44 commented 4 years ago

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 commented 4 years ago

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