Use ADCM to run SQL
You can use the ADCM UI to execute SQL queries.
Execute an SQL query
To execute a query, open the CLUSTERS → ADPG cluster → Services tab. Click in the Actions column to display a list of possible actions. Select the Run SQL action. The Run SQL action executes SQL queries on behalf of the
postgres
superuser.

In the opened form, specify the required database name in the Database for query field and an SQL query in the SQL query field.

In the image above, the SQL query adds Leo Tolstoy
to the author
table and information about his book — "War and Peace" to the book
table. The author
and book
tables belong to the test books_store
database, the creation of which is described in the following article: Example of working with tables via psql.
View the result
To see the SQL query result, open the JOBS tab and click the Run SQL action name.

In the opened form, expand the Result SQL query item. SQL query and its result are displayed.

The query result contains SQL query
,rc
, stdout
, and stderr
fields described in the table below.
Field name | Description |
---|---|
SQL query |
SQL query text |
rc |
Contains the psql exit status:
|
stdout |
Contains the psql output with the query result |
stderr |
Contains an error message if an error occurs during the query execution |