I have container with Postgres. I have to run one commnad “ALTER ROLE postgres SET search_path = constructor,public;”
I can do next way:
docker exec - it id_container bash
then
psql -U postgres -d postgres
and then:
ALTER ROLE postgres SET search_path = constructor,public;
This script work.
But I want to use this script in one line, like this:
docker exec -it story_date_db bash | psql -U postgres -d postgres ALTER ROLE postgres SET search_path = ts_pfa2_constructor,public;
Unfortunately this code returns error:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
psql: warning: extra command-line argument "ALTER" ignored
psql: warning: extra command-line argument "ROLE" ignored
psql: warning: extra command-line argument "postgres" ignored
psql: warning: extra command-line argument "SET" ignored
psql: warning: extra command-line argument "search_path" ignored
psql: warning: extra command-line argument "=" ignored
psql: warning: extra command-line argument "constructor,public" ignored
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?