I was trying to break a long command line involving psql
command string (i.e. psql -c
),and this seems to cause errors. For example, with PostgreSQL 9.5 and Ubuntu 16.04:
$ psql -c "\\dt"
works fine, while
$ psql -c "
> \\dt
> "
generates:
ERROR: syntax error at or near "\"
LINE 2: \dt
Just out of curiosity, when is it OK to insert newlines (i.e. \n
) into a psql
command string?