In the psql shell . It working fine to run sql . But when i use the psql -c . It's has problem.
postgres@03e0948a4fed:/home/data$ psql --c "select version();"
version
----------------------------------------------------------------------------------------------------------------------------------
PostgreSQL 11.4 (Debian 11.4-1.pgdg90+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit
(1 row)
postgres@03e0948a4fed:/home/data$ psql
psql (11.4 (Debian 11.4-1.pgdg90+1))
Type "help" for help.
postgres=# truncate table "TEST"."E0005";
TRUNCATE TABLE
postgres@03e0948a4fed:/home/data$ psql --c "truncate" "table" "TEST"."E0005";
psql: FATAL: role "TEST.E0005" does not exist
postgres@03e0948a4fed:/home/data$ psql --c "truncate table TEST.E0005;" `ERROR: schema "TEST" does not exist.`
-cnot--c