mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Remove some unused index directives.
This commit is contained in:
parent
04beec1309
commit
1f4a814e72
@ -1,8 +1,8 @@
|
||||
.. _connect_error:
|
||||
|
||||
**************************
|
||||
`Connection error`:index:
|
||||
**************************
|
||||
******************
|
||||
`Connection error`
|
||||
******************
|
||||
|
||||
When connecting to a PostgreSQL server, you may get an error message. If you encounter an error message, please review the message carefully; each error message attempts to incorporate the information you'll need to resolve the problem. For more details about specific errors, please locate the error message in the list below:
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
.. _debugger:
|
||||
|
||||
*************************
|
||||
`pgAdmin Debugger`:index:
|
||||
*************************
|
||||
******************
|
||||
`pgAdmin Debugger`
|
||||
******************
|
||||
|
||||
.. image:: images/debug_main.png
|
||||
|
||||
|
@ -1,72 +1,72 @@
|
||||
.. _pgagent_install:
|
||||
|
||||
|
||||
***************************
|
||||
`Installing pgAgent`:index:
|
||||
***************************
|
||||
|
||||
pgAgent runs as a daemon on Unix systems, and a service on Windows systems. In most cases it will run on the database server itself - for this reason, pgAgent is not automatically configured when pgAdmin is installed. In some cases however, it may be preferable to run pgAgent on multiple systems, against the same database; individual jobs may be targeted at a particular host, or left for execution by any host. Locking prevents execution of the same instance of a job by multiple hosts.
|
||||
|
||||
Database setup
|
||||
==============
|
||||
|
||||
Before using pgAdmin to manage pgAgent, you must create the pgAgent extension in the maintenance database registered with pgAdmin. To install pgAgent on a PostgreSQL host, connect to the *postgres* database, and navigate through the *Tools* menu to open the Query tool. For server versions 9.1 or later, and pgAgent 3.4.0 or later, enter the following command in the query window, and click the *Execute* icon::
|
||||
|
||||
CREATE EXTENSION pgagent;
|
||||
|
||||
This command will create a number of tables and other objects in a schema called 'pgagent'.
|
||||
.. _pgagent_install:
|
||||
|
||||
|
||||
********************
|
||||
`Installing pgAgent`
|
||||
********************
|
||||
|
||||
pgAgent runs as a daemon on Unix systems, and a service on Windows systems. In most cases it will run on the database server itself - for this reason, pgAgent is not automatically configured when pgAdmin is installed. In some cases however, it may be preferable to run pgAgent on multiple systems, against the same database; individual jobs may be targeted at a particular host, or left for execution by any host. Locking prevents execution of the same instance of a job by multiple hosts.
|
||||
|
||||
Database setup
|
||||
==============
|
||||
|
||||
Before using pgAdmin to manage pgAgent, you must create the pgAgent extension in the maintenance database registered with pgAdmin. To install pgAgent on a PostgreSQL host, connect to the *postgres* database, and navigate through the *Tools* menu to open the Query tool. For server versions 9.1 or later, and pgAgent 3.4.0 or later, enter the following command in the query window, and click the *Execute* icon::
|
||||
|
||||
CREATE EXTENSION pgagent;
|
||||
|
||||
This command will create a number of tables and other objects in a schema called 'pgagent'.
|
||||
|
||||
The database must also have the pl/pgsql procedural language installed - use the PostgreSQL CREATE LANGUAGE command to install pl/pgsql if necessary. To install pl/pgsql, enter the following command in the query window, and click the *Execute* icon::
|
||||
|
||||
CREATE LANGUAGE plpgsql;
|
||||
|
||||
CREATE LANGUAGE plpgsql;
|
||||
|
||||
If you are using an earlier version of PostgreSQL or pgAgent, use the *Open file* icon on the Query Tool toolbar to open a browser window and locate the *pgagent.sql* script. The installation script is installed by pgAdmin, and the installation location varies from operating system to operating system:
|
||||
* On Windows, it is usually located under *C:\Program files\pgAdmin III* (or *C:\Program files\PostgreSQL\8.x\pgAdmin III* if installed with the PostgreSQL server installer).
|
||||
* On Linux, it is usually located under */usr/local/pgadmin3/share/pgadmin3* or */usr/share/pgadmin3*.
|
||||
|
||||
After loading the file into the Query Tool, click the *Execute* icon to execute the script. The script will create a number of tables and other objects in a schema named *pgagent*.
|
||||
|
||||
Daemon installation on Unix
|
||||
===========================
|
||||
|
||||
To install the pgAgent daemon on a Unix system, you will normally need to have root privileges to modify the system startup scripts. Modifying system startup scripts is quite system-specific so you should consult your system documentation for further information.
|
||||
|
||||
The program itself takes few command line options, most of which are only needed for debugging or specialised configurations::
|
||||
|
||||
Usage:
|
||||
/path/to/pgagent [options] <connect-string>
|
||||
|
||||
options:
|
||||
-f run in the foreground (do not detach from the terminal)
|
||||
-t <poll time interval in seconds (default 10)>
|
||||
-r <retry period after connection abort in seconds (>=10, default 30)>
|
||||
-s <log file (messages are logged to STDOUT if not specified)>
|
||||
-l <logging verbosity (ERROR=0, WARNING=1, DEBUG=2, default 0)>
|
||||
|
||||
The connection string is a standard PostgreSQL libpq connection string (see the `PostgreSQL documentation on the connection string <http://www.postgresql.org/docs/current/static/libpq.html#libpq-connect>`_ for further details). For example, the following command line will run pgAgent against a server listening on the localhost, using a database called 'pgadmin', connecting as the user 'postgres'::
|
||||
|
||||
/path/to/pgagent hostaddr=127.0.0.1 dbname=postgres user=postgres
|
||||
|
||||
Service installation on Windows
|
||||
===============================
|
||||
|
||||
pgAgent can install itself as a service on Windows systems. The command line options available are similar to those on Unix systems, but include an additional parameter to tell the service what to do::
|
||||
|
||||
Usage:
|
||||
pgAgent REMOVE <serviceName>
|
||||
pgAgent INSTALL <serviceName> [options] <connect-string>
|
||||
pgAgent DEBUG [options] <connect-string>
|
||||
|
||||
options:
|
||||
-u <user or DOMAIN\user>
|
||||
-p <password>
|
||||
-d <displayname>
|
||||
-t <poll time interval in seconds (default 10)>
|
||||
-r <retry period after connection abort in seconds (>=10, default 30)>
|
||||
-l <logging verbosity (ERROR=0, WARNING=1, DEBUG=2, default 0)>
|
||||
|
||||
The service may be quite simply installed from the command line as follows (adjust the path as required)::
|
||||
|
||||
"C:\Program Files\pgAdmin III\pgAgent" INSTALL pgAgent -u postgres -p secret hostaddr=127.0.0.1 dbname=postgres user=postgres
|
||||
|
||||
You can then start the service at the command line using *net start pgAgent*, or from the *Services* control panel applet. Any logging output or errors will be reported in the Application event log. The DEBUG mode may be used to run pgAgent from a command prompt. When run this way, log messages will output to the command window.
|
||||
After loading the file into the Query Tool, click the *Execute* icon to execute the script. The script will create a number of tables and other objects in a schema named *pgagent*.
|
||||
|
||||
Daemon installation on Unix
|
||||
===========================
|
||||
|
||||
To install the pgAgent daemon on a Unix system, you will normally need to have root privileges to modify the system startup scripts. Modifying system startup scripts is quite system-specific so you should consult your system documentation for further information.
|
||||
|
||||
The program itself takes few command line options, most of which are only needed for debugging or specialised configurations::
|
||||
|
||||
Usage:
|
||||
/path/to/pgagent [options] <connect-string>
|
||||
|
||||
options:
|
||||
-f run in the foreground (do not detach from the terminal)
|
||||
-t <poll time interval in seconds (default 10)>
|
||||
-r <retry period after connection abort in seconds (>=10, default 30)>
|
||||
-s <log file (messages are logged to STDOUT if not specified)>
|
||||
-l <logging verbosity (ERROR=0, WARNING=1, DEBUG=2, default 0)>
|
||||
|
||||
The connection string is a standard PostgreSQL libpq connection string (see the `PostgreSQL documentation on the connection string <http://www.postgresql.org/docs/current/static/libpq.html#libpq-connect>`_ for further details). For example, the following command line will run pgAgent against a server listening on the localhost, using a database called 'pgadmin', connecting as the user 'postgres'::
|
||||
|
||||
/path/to/pgagent hostaddr=127.0.0.1 dbname=postgres user=postgres
|
||||
|
||||
Service installation on Windows
|
||||
===============================
|
||||
|
||||
pgAgent can install itself as a service on Windows systems. The command line options available are similar to those on Unix systems, but include an additional parameter to tell the service what to do::
|
||||
|
||||
Usage:
|
||||
pgAgent REMOVE <serviceName>
|
||||
pgAgent INSTALL <serviceName> [options] <connect-string>
|
||||
pgAgent DEBUG [options] <connect-string>
|
||||
|
||||
options:
|
||||
-u <user or DOMAIN\user>
|
||||
-p <password>
|
||||
-d <displayname>
|
||||
-t <poll time interval in seconds (default 10)>
|
||||
-r <retry period after connection abort in seconds (>=10, default 30)>
|
||||
-l <logging verbosity (ERROR=0, WARNING=1, DEBUG=2, default 0)>
|
||||
|
||||
The service may be quite simply installed from the command line as follows (adjust the path as required)::
|
||||
|
||||
"C:\Program Files\pgAdmin III\pgAgent" INSTALL pgAgent -u postgres -p secret hostaddr=127.0.0.1 dbname=postgres user=postgres
|
||||
|
||||
You can then start the service at the command line using *net start pgAgent*, or from the *Services* control panel applet. Any logging output or errors will be reported in the Application event log. The DEBUG mode may be used to run pgAgent from a command prompt. When run this way, log messages will output to the command window.
|
||||
|
@ -1,18 +1,18 @@
|
||||
.. _pgagent_jobs:
|
||||
|
||||
|
||||
*******************************
|
||||
`Creating a pgAgent Job`:index:
|
||||
*******************************
|
||||
|
||||
.. _pgagent_jobs:
|
||||
|
||||
|
||||
************************
|
||||
`Creating a pgAgent Job`
|
||||
************************
|
||||
|
||||
pgAgent is a scheduling agent that runs and manages jobs; each job consists of steps and schedules.
|
||||
|
||||
To create or manage a job, use the pgAdmin tree control to browse to the server on which the pgAgent database objects were created. The tree control will display a *pgAgent Jobs* node, under which currently defined jobs are displayed. To add a new job, right click on the *pgAgent Jobs* node, and select *Create pgAgent Job...* from the context menu.
|
||||
|
||||
When the pgAgent dialog opens, use the tabs on the *pgAgent Job* dialog to define the steps and schedule that make up a pgAgent job.
|
||||
|
||||
.. image:: images/pgagent_general.png
|
||||
|
||||
|
||||
.. image:: images/pgagent_general.png
|
||||
|
||||
Use the fields on the *General* tab to provide general information about a job:
|
||||
|
||||
* Provide a name for the job in the *Name* field.
|
||||
@ -20,20 +20,20 @@ Use the fields on the *General* tab to provide general information about a job:
|
||||
* Use the *Job Class* drop-down to select a class (for job categorization).
|
||||
* Use the *Host Agent* field to specify the name of a machine that is running pgAgent to indicate that only that machine may execute the job. Leave the field blank to specify that any machine may perform the job.
|
||||
|
||||
**Note:** It is not always obvious what value to specify for the Host Agent in order to target a job step to a specific machine. With pgAgent running on the required machines and connected to the scheduler database, you can use the following query to view the hostnames as reported by each agent::
|
||||
|
||||
SELECT jagstation FROM pgagent.pga_jobagent
|
||||
|
||||
Use the hostname exactly as reported by the query in the Host Agent field.
|
||||
**Note:** It is not always obvious what value to specify for the Host Agent in order to target a job step to a specific machine. With pgAgent running on the required machines and connected to the scheduler database, you can use the following query to view the hostnames as reported by each agent::
|
||||
|
||||
SELECT jagstation FROM pgagent.pga_jobagent
|
||||
|
||||
Use the hostname exactly as reported by the query in the Host Agent field.
|
||||
|
||||
* Use the *Comment* field to store notes about the job.
|
||||
|
||||
.. image:: images/pgagent_steps.png
|
||||
|
||||
.. image:: images/pgagent_steps.png
|
||||
|
||||
Use the *Steps* tab to define and manage the steps that the job will perform. Click the Add icon (+) to add a new step; then click the compose icon (located at the left side of the header) to open the step definition dialog:
|
||||
|
||||
.. image:: images/pgagent_step_definition.png
|
||||
|
||||
.. image:: images/pgagent_step_definition.png
|
||||
|
||||
Use fields on the step definition dialog to define the step:
|
||||
|
||||
* Provide a name for the step in the *Name* field; please note that steps will be performed in alphanumeric order by name.
|
||||
@ -115,7 +115,7 @@ Click the *Save* button to save the job definition, or *Cancel* to exit the job
|
||||
|
||||
After saving a job, the job will be listed under the *pgAgent Jobs* node of the pgAdmin tree control of the server on which it was defined. The *Properties* tab in the main pgAdmin window will display a high-level overview of the selected job, and the *Statistics* tab will show the details of each run of the job.
|
||||
|
||||
.. image:: images/pgagent_properties.png
|
||||
.. image:: images/pgagent_properties.png
|
||||
|
||||
To modify an existing job or to review detailed information about a job, right-click on a job name, and select *Properties* from the context menu.
|
||||
|
||||
To modify an existing job or to review detailed information about a job, right-click on a job name, and select *Properties* from the context menu.
|
||||
|
||||
|
@ -1,24 +1,24 @@
|
||||
.. _using_pgagent:
|
||||
|
||||
|
||||
**********************
|
||||
`Using pgAgent`:index:
|
||||
**********************
|
||||
.. _using_pgagent:
|
||||
|
||||
|
||||
***************
|
||||
`Using pgAgent`
|
||||
***************
|
||||
|
||||
pgAgent is a scheduling agent that runs and manages jobs; each job consists of one or more steps and schedules. If two or more jobs are scheduled to execute concurrently, pgAgent will execute the jobs in parallel (each with it's own thread).
|
||||
|
||||
A step may be a series of SQL statements or an operating system batch/shell script. Each step in a given job is executed when the previous step completes, in alphanumeric order by name. Switches on the *pgAgent Job* dialog (accessed through the *Properties* context menu) allow you to modify a job, enabling or disabling individual steps as needed.
|
||||
|
||||
Each job is executed according to one or more schedules. Each time the job or any of its schedules are altered, the next runtime of the job is re-calculated. Each instance of pgAgent periodically polls the database for jobs with the next runtime value in the past. By polling at least once every minute, all jobs will normally start within one minute of the specified start time. If no pgAgent instance is running at the next runtime of a job, it will run as soon as pgAgent is next started, following which it will return to the normal schedule.
|
||||
A step may be a series of SQL statements or an operating system batch/shell script. Each step in a given job is executed when the previous step completes, in alphanumeric order by name. Switches on the *pgAgent Job* dialog (accessed through the *Properties* context menu) allow you to modify a job, enabling or disabling individual steps as needed.
|
||||
|
||||
Each job is executed according to one or more schedules. Each time the job or any of its schedules are altered, the next runtime of the job is re-calculated. Each instance of pgAgent periodically polls the database for jobs with the next runtime value in the past. By polling at least once every minute, all jobs will normally start within one minute of the specified start time. If no pgAgent instance is running at the next runtime of a job, it will run as soon as pgAgent is next started, following which it will return to the normal schedule.
|
||||
|
||||
When you highlight the name of a defined job in the pgAdmin tree control, the *Properties* tab of the main pgAdmin window will display details about the job, and the *Statistics* tab will display details about the job's execution.
|
||||
|
||||
Security concerns
|
||||
=================
|
||||
|
||||
pgAgent is a very powerful tool, but does have some security considerations that you should be aware of:
|
||||
|
||||
**Database password** - *DO NOT* be tempted to include a password in the pgAgent connection string - on Unix systems it may be visible to all users in 'ps' output, and on Windows systems it will be stored in the registry in plain text. Instead, use a libpq *~/.pgpass* file to store the passwords for every database that pgAgent must access. Details of this technique may be found in the `PostgreSQL documentation on .pgpass file <http://www.postgresql.org/docs/current/static/libpq-pgpass.html>`_.
|
||||
|
||||
**System/database access** - all jobs run by pgAgent will run with the security privileges of the pgAgent user. SQL steps will run as the user that pgAgent connects to the database as, and batch/shell scripts will run as the operating system user that the pgAgent service or daemon is running under. Because of this, it is essential to maintain control over the users that are able to create and modify jobs. By default, only the user that created the pgAgent database objects will be able to do this - this will normally be the PostgreSQL superuser.
|
||||
|
||||
When you highlight the name of a defined job in the pgAdmin tree control, the *Properties* tab of the main pgAdmin window will display details about the job, and the *Statistics* tab will display details about the job's execution.
|
||||
|
||||
Security concerns
|
||||
=================
|
||||
|
||||
pgAgent is a very powerful tool, but does have some security considerations that you should be aware of:
|
||||
|
||||
**Database password** - *DO NOT* be tempted to include a password in the pgAgent connection string - on Unix systems it may be visible to all users in 'ps' output, and on Windows systems it will be stored in the registry in plain text. Instead, use a libpq *~/.pgpass* file to store the passwords for every database that pgAgent must access. Details of this technique may be found in the `PostgreSQL documentation on .pgpass file <http://www.postgresql.org/docs/current/static/libpq-pgpass.html>`_.
|
||||
|
||||
**System/database access** - all jobs run by pgAgent will run with the security privileges of the pgAgent user. SQL steps will run as the user that pgAgent connects to the database as, and batch/shell scripts will run as the operating system user that the pgAgent service or daemon is running under. Because of this, it is essential to maintain control over the users that are able to create and modify jobs. By default, only the user that created the pgAgent database objects will be able to do this - this will normally be the PostgreSQL superuser.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user