Обсуждение: Container deploy & PSQL tool

Поиск
Список
Период
Сортировка

Container deploy & PSQL tool

От
Paolo Saudin
Дата:
Hi,
I installed pgAdmin4 with the directory "/var/lib/pgadmin" mapped locally. I then set the PGADMIN_CONFIG_ENABLE_PSQL to True to be able to use the PSQL TOOL.

Now when I exit the console with "\q" I get the following error: 'could not save history to file "/home/pgadmin/.psql_history": No such file or directory'.  Is it possible to map this directory as well?

Last question, where can I create a .psqlrc file?

Than you,
Paolo Saudin


Re: Container deploy & PSQL tool

От
Aditya Toshniwal
Дата:
Hi Paolo,

I did something like this to mount my host home directory to docker /home/pgadmin. .psqlrc defaults to user home directory which is /home/pgadmin. Can you try this once ?

docker run -p 80:80 \

    -v /Users/adityatoshniwal:/home/pgadmin \

    -e 'PGADMIN_DEFAULT_EMAIL=user@domain.com' \

    -e 'PGADMIN_DEFAULT_PASSWORD=SuperSecret' \

    -d dpage/pgadmin4


On Mon, Aug 16, 2021 at 10:58 AM Paolo Saudin <paolosaudin@gmail.com> wrote:
Hi,
I installed pgAdmin4 with the directory "/var/lib/pgadmin" mapped locally. I then set the PGADMIN_CONFIG_ENABLE_PSQL to True to be able to use the PSQL TOOL.

Now when I exit the console with "\q" I get the following error: 'could not save history to file "/home/pgadmin/.psql_history": No such file or directory'.  Is it possible to map this directory as well?

Last question, where can I create a .psqlrc file?

Than you,
Paolo Saudin




--
Thanks,
Aditya Toshniwal
pgAdmin hacker | Sr. Software Engineer | edbpostgres.com
"Don't Complain about Heat, Plant a TREE"

Re: Container deploy & PSQL tool

От
Paolo Saudin
Дата:
Thank you very much, I managed to map the directory and now all is fine!
Paolo

docker run -p 5050:80 \
        -v pga4volume:/var/lib/pgadmin \
        -v pga4volume:/home/pgadmin \
        -e 'PGADMIN_DEFAULT_EMAIL=user@domain.com' \
        -e 'PGADMIN_DEFAULT_PASSWORD=SuperSecret' \
        -e 'PGADMIN_CONFIG_ENABLE_PSQL=True \
        -d dpage/pgadmin4


-> sudo ls -lart /var/lib/docker/volumes/pga4volume/_data/
drwxr-xr-x 3 5050 5050 4096 Jan 24 2019 ..
drwxr-xr-x 7 5050 5050 4096 Jun 22 2020 storage
drwx------ 3 5050 5050 16384 Aug 18 04:49 sessions
-rw------- 1 5050 5050 26 Aug 18 05:06 .psql_history
-rw------- 1 5050 5050 40964096 Aug 18 05:06 pgadmin4.db
-rw-r--r-- 1 5050 5050 7514 Aug 18 05:07 .psqlrc
drwx------ 4 5050 5050 4096 Aug 18 05:07 .


Il giorno mer 18 ago 2021 alle ore 06:33 Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> ha scritto:
Hi Paolo,

I did something like this to mount my host home directory to docker /home/pgadmin. .psqlrc defaults to user home directory which is /home/pgadmin. Can you try this once ?

docker run -p 80:80 \

    -v /Users/adityatoshniwal:/home/pgadmin \

    -e 'PGADMIN_DEFAULT_EMAIL=user@domain.com' \

    -e 'PGADMIN_DEFAULT_PASSWORD=SuperSecret' \

    -d dpage/pgadmin4


On Mon, Aug 16, 2021 at 10:58 AM Paolo Saudin <paolosaudin@gmail.com> wrote:
Hi,
I installed pgAdmin4 with the directory "/var/lib/pgadmin" mapped locally. I then set the PGADMIN_CONFIG_ENABLE_PSQL to True to be able to use the PSQL TOOL.

Now when I exit the console with "\q" I get the following error: 'could not save history to file "/home/pgadmin/.psql_history": No such file or directory'.  Is it possible to map this directory as well?

Last question, where can I create a .psqlrc file?

Than you,
Paolo Saudin




--
Thanks,
Aditya Toshniwal
pgAdmin hacker | Sr. Software Engineer | edbpostgres.com
"Don't Complain about Heat, Plant a TREE"

Re: Container deploy & PSQL tool

От
Dave Page
Дата:
Hi

On Wed, Aug 18, 2021 at 5:33 AM Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> wrote:
Hi Paolo,

I did something like this to mount my host home directory to docker /home/pgadmin. .psqlrc defaults to user home directory which is /home/pgadmin. Can you try this once ?

docker run -p 80:80 \

    -v /Users/adityatoshniwal:/home/pgadmin \

    -e 'PGADMIN_DEFAULT_EMAIL=user@domain.com' \

    -e 'PGADMIN_DEFAULT_PASSWORD=SuperSecret' \

    -d dpage/pgadmin4


That will certainly work (as Paolo has confirmed) for a single user, however, I think we should set PSQLRC and PSQL_HISTORY in the environment for psql when running in server mode such that those files go into each individual user's storage directory.

Can you raise an RM for that and take a look at it please Aditya?
 

On Mon, Aug 16, 2021 at 10:58 AM Paolo Saudin <paolosaudin@gmail.com> wrote:
Hi,
I installed pgAdmin4 with the directory "/var/lib/pgadmin" mapped locally. I then set the PGADMIN_CONFIG_ENABLE_PSQL to True to be able to use the PSQL TOOL.

Now when I exit the console with "\q" I get the following error: 'could not save history to file "/home/pgadmin/.psql_history": No such file or directory'.  Is it possible to map this directory as well?

Last question, where can I create a .psqlrc file?

Than you,
Paolo Saudin




--
Thanks,
Aditya Toshniwal
pgAdmin hacker | Sr. Software Engineer | edbpostgres.com
"Don't Complain about Heat, Plant a TREE"


--

Re: Container deploy & PSQL tool

От
Paolo Saudin
Дата:
Hi,
last couple of requests/help if possible:

1. if I paste from clipboard to PSQL TOOL I get the message "To paste data on the PSQL terminal, Clipboard read permission required.". I cannot find a related option in the configuration, may be it's not possible to date.

2. install PSPG into the container to be able to use it for pagination. Can I do it myself?
pgstage13:5432 postgres@rete_llpp=# select * from metadata.stations;
sh: pspg: not found

Thanks,
Paolo



Il giorno mer 18 ago 2021 alle ore 08:55 Dave Page <dpage@pgadmin.org> ha scritto:
Hi

On Wed, Aug 18, 2021 at 5:33 AM Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> wrote:
Hi Paolo,

I did something like this to mount my host home directory to docker /home/pgadmin. .psqlrc defaults to user home directory which is /home/pgadmin. Can you try this once ?

docker run -p 80:80 \

    -v /Users/adityatoshniwal:/home/pgadmin \

    -e 'PGADMIN_DEFAULT_EMAIL=user@domain.com' \

    -e 'PGADMIN_DEFAULT_PASSWORD=SuperSecret' \

    -d dpage/pgadmin4


That will certainly work (as Paolo has confirmed) for a single user, however, I think we should set PSQLRC and PSQL_HISTORY in the environment for psql when running in server mode such that those files go into each individual user's storage directory.

Can you raise an RM for that and take a look at it please Aditya?
 

On Mon, Aug 16, 2021 at 10:58 AM Paolo Saudin <paolosaudin@gmail.com> wrote:
Hi,
I installed pgAdmin4 with the directory "/var/lib/pgadmin" mapped locally. I then set the PGADMIN_CONFIG_ENABLE_PSQL to True to be able to use the PSQL TOOL.

Now when I exit the console with "\q" I get the following error: 'could not save history to file "/home/pgadmin/.psql_history": No such file or directory'.  Is it possible to map this directory as well?

Last question, where can I create a .psqlrc file?

Than you,
Paolo Saudin




--
Thanks,
Aditya Toshniwal
pgAdmin hacker | Sr. Software Engineer | edbpostgres.com
"Don't Complain about Heat, Plant a TREE"


--

Re: Container deploy & PSQL tool

От
Aditya Toshniwal
Дата:
Hi Dave,

On Wed, Aug 18, 2021 at 12:25 PM Dave Page <dpage@pgadmin.org> wrote:
Hi

On Wed, Aug 18, 2021 at 5:33 AM Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> wrote:
Hi Paolo,

I did something like this to mount my host home directory to docker /home/pgadmin. .psqlrc defaults to user home directory which is /home/pgadmin. Can you try this once ?

docker run -p 80:80 \

    -v /Users/adityatoshniwal:/home/pgadmin \

    -e 'PGADMIN_DEFAULT_EMAIL=user@domain.com' \

    -e 'PGADMIN_DEFAULT_PASSWORD=SuperSecret' \

    -d dpage/pgadmin4


That will certainly work (as Paolo has confirmed) for a single user, however, I think we should set PSQLRC and PSQL_HISTORY in the environment for psql when running in server mode such that those files go into each individual user's storage directory.

Can you raise an RM for that and take a look at it please Aditya?
Got it. I'll create the RM.
 

On Mon, Aug 16, 2021 at 10:58 AM Paolo Saudin <paolosaudin@gmail.com> wrote:
Hi,
I installed pgAdmin4 with the directory "/var/lib/pgadmin" mapped locally. I then set the PGADMIN_CONFIG_ENABLE_PSQL to True to be able to use the PSQL TOOL.

Now when I exit the console with "\q" I get the following error: 'could not save history to file "/home/pgadmin/.psql_history": No such file or directory'.  Is it possible to map this directory as well?

Last question, where can I create a .psqlrc file?

Than you,
Paolo Saudin




--
Thanks,
Aditya Toshniwal
pgAdmin hacker | Sr. Software Engineer | edbpostgres.com
"Don't Complain about Heat, Plant a TREE"


--


--
Thanks,
Aditya Toshniwal
pgAdmin hacker | Sr. Software Engineer | edbpostgres.com
"Don't Complain about Heat, Plant a TREE"