1

I have PostgreSQL running in Docker. The host system is Ubuntu 18.04.3. Every time I execute some SQL in PostgreSQL I get

/var/lib/pgsql/.role.sh: not found

Does anyone know why this is or at least what the .role.sh script is? The SQL code seem to work anyway though.

The container is running under a non-root user that exists with the same uid, gid on both the container and host, as per security recommendation.

Output of SELECT version(); in container:

PostgreSQL 12.0 (Debian 12.0-2.pgdg100+1) on x86_64-pc-linux-gnu [...]

Image of PostgreSQL command and error:

Image of PostgreSQL command and error.

  • So, does that /var/lib/pgsql/.role.sh file exist? I found a reference to it here on this other site. – JakeGould Oct 16 at 13:51
  • Thx for the answer. It doesn't seem like it. I tried running ls -la /var/lib/pgsql in the container and it says there's no such file or directory. I don't really get what the file does from the site you linked (I am new to this) or why its trying to find this .role.sh script... – Filip Sjöstrand Oct 16 at 14:08
  • Well, I didn’t post an answer. I posted a comment. Comments are typically conversations to clarify issues. And answers are solid answers. I have no such thing. Hope you can resolve this! – JakeGould Oct 16 at 14:46
  • Oops, wrong word by mistake although I actually did know that, thx anyway. I tried having having the .role.sh and the .psqlrc in the site you linked copied to the directory when building the docker image; still it tells me "not found". Which I find super strange. Oh well... – Filip Sjöstrand Oct 16 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.