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.

1
  • 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... Commented Oct 16, 2019 at 14:08

1 Answer 1

0

I think your prompt is referencing /var/lib/pgsql/.role.sh. Check your ~/.psqlrc file, specifically line starting with \set PROMPT1. If applicable remove the part with the reference:

%`/var/lib/pgsql/.role.sh\`

Alternatively you could add the missing script following this guide. It will display your current role in the PSQL prompt: https://simply.name/yet-another-psql-color-prompt.html

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .