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.

Giacomo1968
  • 58,727

1 Answers1

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

Anna
  • 11