Connection Pool(s) Configuration
A connection pool is a set of ad-hoc connections to access databases, maintained so that the connections can be reused when future requests to the databases are made.
To enable this operation, PgSmart integrates with [PgBouncer](* PgBouncer).
pgsmart pool config [Flags]
Flags:
- -a, --agent=<agent>=> Alias, host name or IP of the server where the PgSmart Agent is installed.
- -h, --help=> Help.
- -q, --quiet=> Non-interactive execution. You can view the operation results in PgSmart Client log. Used together with --agent.
Non-interactive execution is disabled for this operation.
pgsmart pool config
- 
Select PgSmart Agent(or Register new Agent).
- 
Select the Connection Poolssection (selection is made with the [spaces] key).Upon selecting the Connection Poolssection, the following operations are made available:- List the already configured Pools of Connection: Allows viewing the existing connection Pools.
- Create a Connections Pool: Allows creating a new connection Pool.
- Edit a Connections Pool: Allows editing a connection Pool.
- Remove a Connections Pool: Allows removing a connection Pool.
 
List the already configured Pools of Connection
- Instructions
- Video
- 
Select the Listoperation. Figure 1 - Connection Pool Configuration- list Figure 1 - Connection Pool Configuration- list
The list of configured Connection Pools will be presented.
Create a Connections Pool
- Instructions
- Video
- 
Select the Createoption.
- 
Provide the Name of the Pool that applications/clients will connect to. The asterisk (*) indicates that if there is no pool available at the time of connection to the database with the specified name, a standard pool already existing in PgBouncer will be used. 
- 
Provide the Type of Connection.
- 
Provide the IP connection of the PostgreSYS instance[Default:localhost].
- 
Provide the Connection Port of the PostgreSQL instance.
- 
Select the Major Version of PostgreSQLor theData Directory(whichever is requested).
- 
Provide the Name of the Database.
- 
Confirm if you want to add advanced parameters for this Pool (the default parameters will be overwritten). If the need to add advanced parameters is confirmed: 8.1. Provide the Database Connection User(user). [optional]8.2. Provide the User used to query in the PostgreSQL instance(auth_user). [optional]8.3. Provide the Maximum Pool Size(pool_size). [optional]8.4. Provide the Number of additional reserved connections(reserved_pool) [optional].8.5. Provide the Query (within single quotes) to be executed after the connectionto the Database is stabilized (connect_query) [optional]8.6. Select the Connection Reuse Mode[optional].8.7. Provide the Maximum Number of Connectionsin the Database (max_db_connections). [optional]8.8. Provide the Character Encodingto be used in the connection (client_encoding). [optional]8.9. Provide the Date Styleto be used in the connection (datestyle). [optional]8.10. Provide the Time Zoneto be used in the connection (timezone). [optional]
- 
Confirm the creation of the Connections Pool. noteParameters not informed have their values assumed based on the Global Parameters, whose values are adopted as "default". note- 
Upon completion of the creation, PgSmart offers an example command to test the connection and a series of recommendations. 
- 
To test the connection, execute the command: 
 Terminal inputpsql -U <User> -h <IP-address> -p 6432 apppool
- 

Edit a Connections Pool
- Instructions
- Video
- 
Select the Editoption.noteWhen selecting this action, PgSmart will provide a list with the Pools already configured. 
- 
Select the configured Pool you wish to change and adjust. 
- 
Provide the Name of the Poolwhich the applications/Clients will connect to (Default: pool1)
- 
Select the Type of Connection.
- 
Provide the IP/hostname of the PostgreSQL instance[Default: localhost]
- 
Provide the Port of the PostgreSQL instance[Default:5432]
- 
Select the Major version of the PostgreSQL instance.
- 
Provide the Name of the Database(optional for Unix Socket or AutoDB)
- 
Confirm the Edition of advanced parameters for this Pool(the default parameters will be overwritten). If the need to add advanced parameters is confirmed: 9.1. Provide the Database connection user(user). [optional]. If informed, it will require that the User be the one informed. If not informed, any User will have permission.9.2. Provide the User used to query in the PostgreSQL instance(auth_user). [optional]. User who will be used for authentication in the instance. If not informed and there is no User in the authentication file, PgSmart will reject the connection.9.3. Provide the Maximum Pool Size(pool_size). [optional]. Maximum number of pool connections.9.4. Provide the Number of additional reserved connections(reserved_pool) [optional]. Indicates that, of the total number of connections, a specified volume should be reserved for a superuser or a Maintenance User.9.5. Provide the Query (within single quotes) to be executed after the connectionto the Database is stabilized (connect_query) [optional]. Indicates the query to be used to validate the connection. Empty indicates the use of a standard query.9.6. Select the Connection Reuse Mode[optional]. If not informed, the Default will be adopted, which is "session" (or the one defined in the Global Parameter, in case it has been modified).9.7. Provide the Maximum Number of connectionsin the Database (max_db_connections). [optional].9.8. Provide the Character Encodingto be used in the connection (client_encoding). [optional]9.9. Provide the Date Styleto be used in the connection (datestyle). [optional]9.10. Provide the Time Zoneto be used in the connection (timezone). [optional]noteParameters not informed have their values assumed based on the Global Parameters, whose values are adopted as "default". 
- 
Confirm the Edition of the Connections Pool. 

Remove a Connections Pool
- Instructions
- Video
- 
Select the Removeoperation.noteWhen selecting this action, PgSmart will provide a list with the Pools already configured. 
- 
Select the Poolconfigured that you wish to remove.
- 
Confirm the Deletion of the Connections Pool. 
