I'm facing an issue while performing a pg_dump of an existing database into two SQL files.
- One file is intended for a schema-only dump.
- The other is for a data-only dump
The command for the schema-only dump executes successfully using the following command:
psql -u dbuser -d empDatabase -f C:\SchemaOnlyDump.sql
However, the data-only dump encounters an error, specifically,ERROR: syntax error at or near '\.'
psql -u dbuser -d empDatabase -f C:\DataOnlyDump.sql
The data-only dump file has the following content:
Looks like PostgreSQL is interpreting the '.' symbol as part of SQL syntax whereas it serves a special purpose within the context of COPY commands executed in 'psql'
How can I execute the data-only SQL to populate the data into the database?

pg_dumpall, the first line of the generated command would beCOPY employee (empid, name, position) FROM stdin;.psqlorpgAdmin4? I have seen issues withpgAdminandCOPY. I routinely run data only dumps that useCOPYthroughpsqlwith no issue. Add to your question text the complete error message as text(not as an image).C:\data-only-dump.sqltopsqlshould not be an issue. Verify what @ÁlvaroGonzález mentioned.