Re: Adding new server in pgadmin from command line

Поиск
Список
Период
Сортировка
От Yogesh Mahajan
Тема Re: Adding new server in pgadmin from command line
Дата
Msg-id CAMa=N=OYXNzMcJhYAvs9P+LSLicyyY=SwoFRnGPruw-pVK=mfg@mail.gmail.com
обсуждение исходный текст
Ответ на Adding new server in pgadmin from command line  (Asmita Thapliyal <asmita.thapliyal@gmail.com>)
Ответы Re: Adding new server in pgadmin from command line  (Asmita Thapliyal <asmita.thapliyal@gmail.com>)
Список pgadmin-support
Hi Asmita,

Here are the steps to add servers using command line. Inserting data entries directly may lead to unexpected behaviour.


Thanks,
Yogesh Mahajan
EnterpriseDB


On Tue, May 3, 2022 at 2:39 PM Asmita Thapliyal <asmita.thapliyal@gmail.com> wrote:
Hello Team,

I would like to perform server addition activity in pgadmin from the command line.
I tried to add newserver in pgadmin following below procedure.

Create a migration file with the following command:

(venv) $ FLASK_APP=pgAdmin4.py flask db revision

This will create a file in: $PGADMIN4_SRC/web/migrations/versions/ . Add any changes to the 'upgrade' function. Increment the SCHEMA_VERSION in $PGADMIN4_SRC/web/pgadmin/model/init.py file.Below is the upgrade function command I am using.


db.engine.execute("""
    INSERT INTO server (
        id, user_id, servergroup_id, name, host, port, maintenance_db,
        username, password, ssl_mode
    ) VALUES ( 1, 1, 1, "stagdb", "<hostname>", 5454, "mpsdb", "mproot", "<password>", "prefer" )
    """ )
and restart pgadmin.

But during pgdmin restart I get a db migration exception without any error details. Is this the correct procedure I am following? can we add servers in pgadmin from the command line instead of UI?

Regards,
Asmita

В списке pgadmin-support по дате отправления:

Предыдущее
От: Garrett Simpson
Дата:
Сообщение: Estimated release date for official pgadmin4 repos for Ubuntu 22.04 Jammy Jellyfish?
Следующее
От: David Bear
Дата:
Сообщение: 2 pgadmin4 instances