Sample Header Ad - 728x90

Error with non-standard identifier in \copy command

0 votes
1 answer
292 views
Would like to be able to add characters like '-' in the schema name when running COPY command in PostgreSQL. Any way to get around this?
psql -d postgres -c "\COPY (SELECT * FROM test-schema.tableName) TO data.csv DELIMITER ',' CSV"
>
> ERROR:  syntax error at or near "-"enter code here
> LINE 1: COPY  ( SELECT * FROM test-schema.tableName ) TO STDOUT DELIMITER ',...
>
Asked by amateur (103 rep)
Aug 12, 2021, 09:15 PM
Last activity: Aug 12, 2021, 10:12 PM