From: | Asmita Thapliyal <asmita(dot)thapliyal(at)gmail(dot)com> |
---|---|
To: | "pgadmin-support lists(dot)postgresql(dot)org" <pgadmin-support(at)lists(dot)postgresql(dot)org> |
Subject: | Adding new server in pgadmin from command line |
Date: | 2022-04-30 10:57:15 |
Message-ID: | CAMgBNbHhkw6afzJswHyK+GQrpG-i0_rshK705H9cCvsing7MiA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgadmin-support |
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
From | Date | Subject | |
---|---|---|---|
Next Message | Garrett Simpson | 2022-05-03 06:50:18 | Estimated release date for official pgadmin4 repos for Ubuntu 22.04 Jammy Jellyfish? |
Previous Message | Asmita Thapliyal | 2022-04-30 08:44:33 | Re: OAUTH2 Problem with AzureAD |