Skip to content

Commit 53a2ba4

Browse files
authored
Merge pull request #5135 from EnterpriseDB/docs/pge/pge-install-expansion
Expanded PGE docs for install and config (DB-2545)
2 parents 5aacdf2 + 66113ae commit 53a2ba4

35 files changed

+2242
-55
lines changed

install_template/templates/products/edb-postgres-extended-server/base.njk

Lines changed: 91 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{% extends "platformBase/" + platformBaseTemplate + '.njk' %}
22
{% set packageName = packageName or 'edb-postgresextended<xx>-server edb-postgresextended<xx>-contrib' %}
3+
{% set packageName = packageName | replace('<xx>', product.version) %}
34
{% import "platformBase/_deploymentConstants.njk" as deploy %}
45
{% block frontmatter %}
56
{#
@@ -12,6 +13,94 @@ redirects:
1213
{% endblock frontmatter %}
1314
{% block installCommand %}
1415
{{super()}}
15-
Where `<xx>` is the version of EDB Postgres Extended Server you are installing. For example, if you are installing version {{ product.version }}, the package name would be {{packageName | replace('<xx>', product.version)}}.
16+
{% endblock installCommand %}
17+
{% block postinstall %}
1618

17-
{% endblock installCommand %}
19+
## Initial configuration
20+
{% block debian_ubuntu %}
21+
Getting started with your cluster involves logging in, ensuring the installation and initial configuration was successful, connecting to your cluster, and creating the user password.
22+
23+
First, you need to initialize and start the database cluster. The `edb-pge-{{ product.version | replace(".", "") }}-setup` script creates a cluster.
24+
25+
```shell
26+
sudo PGSETUP_INITDB_OPTIONS="-E UTF-8" /usr/edb/pge{{ product.version }}/bin/edb-pge-{{ product.version | replace(".", "") }}-setup initdb
27+
28+
sudo systemctl start edb-pge-{{ product.version }}
29+
```
30+
{% endblock debian_ubuntu %}
31+
32+
To work in your cluster, log in as the postgres user. Connect to the database server using the psql command-line client. Alternatively, you can use a client of your choice with the appropriate connection string.
33+
34+
```shell
35+
sudo -iu postgres
36+
37+
psql postgres
38+
```
39+
40+
The server runs with the `peer` or `ident` permission by default. You can change the authentication method by modifying the `pg_hba.conf` file.
41+
42+
{# this is kinda awful, but gotta deal with the reorg somehow... --jh #}
43+
Before changing the authentication method, assign a password to the database superuser, postgres. For more information on changing the authentication, see [Modifying the pg_hba.conf file](../../administration/01_setting_configuration_parameters/#modifying-the-pg_hbaconf-file).
44+
45+
```sql
46+
ALTER ROLE postgres with PASSWORD 'password';
47+
```
48+
49+
## Experiment
50+
51+
Now you're ready to create and connect to a database, create a table, insert data in a table, and view the data from the table.
52+
53+
First, use psql to create a database named `hr` to hold human resource information.
54+
55+
```sql
56+
# running in psql
57+
CREATE DATABASE hr;
58+
__OUTPUT__
59+
CREATE DATABASE
60+
```
61+
62+
Connect to the `hr` database inside psql:
63+
64+
```
65+
\c hr
66+
__OUTPUT__
67+
You are now connected to database "hr" as user "postgres".
68+
```
69+
70+
Create columns to hold department numbers, unique department names, and locations:
71+
72+
```
73+
CREATE TABLE public.dept (deptno numeric(2) NOT NULL CONSTRAINT dept_pk
74+
PRIMARY KEY, dname varchar(14) CONSTRAINT dept_dname_uq UNIQUE, loc
75+
varchar(13));
76+
__OUTPUT__
77+
CREATE TABLE
78+
```
79+
80+
Insert values into the `dept` table:
81+
82+
```
83+
INSERT INTO dept VALUES (10,'ACCOUNTING','NEW YORK');
84+
__OUTPUT__
85+
INSERT 0 1
86+
```
87+
88+
```
89+
INSERT into dept VALUES (20,'RESEARCH','DALLAS');
90+
__OUTPUT__
91+
INSERT 0 1
92+
```
93+
94+
View the table data by selecting the values from the table:
95+
96+
```
97+
SELECT * FROM dept;
98+
__OUTPUT__
99+
deptno | dname | loc
100+
--------+------------+----------
101+
10 | ACCOUNTING | NEW YORK
102+
20 | RESEARCH | DALLAS
103+
(2 rows)
104+
```
105+
106+
{% endblock postinstall %}

install_template/templates/products/edb-postgres-extended-server/debian-10.njk

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,4 @@
55
```shell
66
sudo {{ packageManager }} {{ packageManagerNoninteractive }} install {{ packageName }}
77
```
8-
9-
Where `<xx>` is the version of EDB Postgres Extended Server you are installing. For example, if you are installing version 15, the package name would be `edb-postgresextended-15`.
10-
118
{% endblock installCommand %}

install_template/templates/products/edb-postgres-extended-server/debian-11.njk

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,4 @@
55
```shell
66
sudo {{ packageManager }} {{ packageManagerNoninteractive }} install {{ packageName }}
77
```
8-
9-
Where `<xx>` is the version of EDB Postgres Extended Server you are installing. For example, if you are installing version 15, the package name would be `edb-postgresextended-15`.
10-
118
{% endblock installCommand %}
Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
{% extends "products/edb-postgres-extended-server/base.njk" %}
2-
{% block debian_ubuntu %}This section steps you through getting started with your cluster including logging in, ensuring the installation was successful, connecting to your cluster, and creating the user password.
2+
{% block debian_ubuntu %}
3+
This section steps you through getting started with your cluster including logging in, ensuring the installation was successful, connecting to your cluster, and creating the user password.
34

4-
```shell{% endblock debian_ubuntu %}
5+
First, you need to initialize and start the database cluster. The `edb-pge-{{ product.version | replace(".", "") }}-setup` script creates a cluster.
6+
7+
```shell
8+
sudo PGSETUP_INITDB_OPTIONS="-E UTF-8" /usr/lib/edb-pge/{{ product.version }}/bin/edb-pge-{{ product.version | replace(".", "") }}-setup initdb
9+
10+
sudo systemctl start edb-pge-{{ product.version }}
11+
```
12+
13+
{% endblock debian_ubuntu %}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{% extends "products/edb-postgres-extended-server/ubuntu.njk" %}
22
{% set platformBaseTemplate = "ubuntu-22.04" %}
3-
{% set packageName %}edb-postgresextended-<xx> edb-postgresextended-<xx>-contrib{% endset %}
3+
{% set packageName %}edb-postgresextended-<xx>{% endset %}
44

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
11
{% extends "products/edb-postgres-extended-server/base.njk" %}
2+
{% block debian_ubuntu %}
3+
This section steps you through getting started with your cluster including logging in, ensuring the installation was successful, connecting to your cluster, and creating the user password.
4+
5+
First, you need to initialize and start the database cluster. The `edb-pge-{{ product.version | replace(".", "") }}-setup` script creates a cluster.
6+
7+
```shell
8+
sudo PGSETUP_INITDB_OPTIONS="-E UTF-8" /usr/lib/edb-pge/{{ product.version }}/bin/edb-pge-{{ product.version | replace(".", "") }}-setup initdb
9+
10+
sudo systemctl start edb-pge-{{ product.version }}
11+
```
12+
13+
{% endblock debian_ubuntu %}

product_docs/docs/migration_toolkit/55/installing/linux_x86_64/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ navigation:
2020
- mtk_sles_12
2121
- mtk_ubuntu_22
2222
- mtk_ubuntu_20
23+
- mtk_ubuntu_18
2324
- mtk_debian_11
2425
- mtk_debian_10
2526
---
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
title: "Setting configuration parameters"
3+
navTitle: "Setting configuration parameters"
4+
description: "Describes how to set the configuration parameters for EDB Postgres Extended Server"
5+
---
6+
7+
Set each configuration parameter using a name/value pair. Parameter names aren't case sensitive. The parameter name is typically separated from its value by an optional equals sign (`=`).
8+
9+
This example shows some configuration parameter settings in the `postgresql.conf` file:
10+
11+
```ini
12+
# This is a comment
13+
log_connections = yes
14+
log_destination = 'syslog'
15+
search_path = '"$user", public'
16+
shared_buffers = 128MB
17+
```
18+
19+
## Types of parameter values
20+
21+
Parameter values are specified as one of five types:
22+
23+
- **Boolean** &mdash; Acceptable values are `on`, `off`, `true`, `false`, `yes`, `no`, `1`, `0`, or any unambiguous prefix of these.
24+
- **Integer** &mdash; Number without a fractional part.
25+
- **Floating point** &mdash; Number with an optional fractional part separated by a decimal point.
26+
- **String** &mdash; Text value enclosed in single quotes if the value isn't a simple identifier or number, that is, the value contains special characters such as spaces or other punctuation marks.
27+
- **Enum** &mdash; Specific set of string values. The allowed values can be found in the system view `pg_settings.enumvals`. Enum values are not case sensitive.
28+
29+
Some settings specify a memory or time value. Each of these has an implicit unit, which is kilobytes, blocks (typically 8 kilobytes), milliseconds, seconds, or minutes. You can find default units by referencing the system view `pg_settings.unit`. You can specify a different unit explicitly.
30+
31+
Valid memory units are:
32+
- `kB` (kilobytes)
33+
- `MB` (megabytes)
34+
- `GB` (gigabytes).
35+
36+
Valid time units are:
37+
- `ms` (milliseconds)
38+
- `s` (seconds)
39+
- `min` (minutes)
40+
- `h` (hours)
41+
- `d` (days).
42+
43+
The multiplier for memory units is 1024.
44+
45+
## Specifying configuration parameter settings
46+
47+
A number of parameter settings are set when the EDB Postgres Extended Server database product is built. These are read-only parameters, and you can't change their values. A couple of parameters are also permanently set for each database when the database is created. These parameters are read-only and you can't later change them for the database. However, there are a number of ways to specify the configuration parameter settings:
48+
49+
- The initial settings for almost all configurable parameters across the entire database cluster are listed in the `postgresql.conf` configuration file. These settings are put into effect upon database server start or restart. You can override some of these initial parameter settings. All configuration parameters have built-in default settings that are in effect unless you explicitly override them.
50+
51+
- Configuration parameters in the `postgresql.conf` file are overridden when the same parameters are included in the `postgresql.auto.conf` file. Use the `ALTER SYSTEM` command to manage the configuration parameters in the `postgresql.auto.conf` file.
52+
53+
- You can modify parameter settings in the configuration file while the database server is running. If the configuration file is then reloaded (meaning a SIGHUP signal is issued), for certain parameter types, the changed parameters settings immediately take effect. For some of these parameter types, the new settings are available in a currently running session immediately after the reload. For others, you must start a new session to use the new settings. And for some others, modified settings don't take effect until the database server is stopped and restarted. See the [PostgreSQL core documentation](https://www.postgresql.org/docs/current/config-setting.html) for information on how to reload the configuration file.
54+
55+
- You can use the SQL commands `ALTER DATABASE`, `ALTER ROLE`, or `ALTER ROLE IN DATABASE` to modify certain parameter settings. The modified parameter settings take effect for new sessions after you execute the command. `ALTER DATABASE` affects new sessions connecting to the specified database. `ALTER ROLE` affects new sessions started by the specified role. `ALTER ROLE IN DATABASE` affects new sessions started by the specified role connecting to the specified database. Parameter settings established by these SQL commands remain in effect indefinitely, across database server restarts, overriding settings established by the other methods. You can change parameter settings established using the `ALTER DATABASE`, `ALTER ROLE`, or `ALTER ROLE IN DATABASE` commands by either:
56+
57+
- Reissuing these commands with a different parameter value.
58+
59+
- Issuing these commands using the `SET parameter TO DEFAULT` clause or the `RESET parameter` clause. These clauses change the parameter back to using the setting set by the other methods. See the [PostgreSQL core documentation](https://www.postgresql.org/docs/current/sql-commands.html) for the syntax of these SQL commands.
60+
61+
- You can make changes for certain parameter settings for the duration of individual sessions using the `PGOPTIONS` environment variable or by using the `SET` command in the EDB-PSQL or PSQL command-line programs. Parameter settings made this way override settings established using any of the methods discussed earlier, but only during that session.
62+
63+
## Modifying the postgresql.conf file
64+
65+
The configuration parameters in the `postgresql.conf` file specify server behavior with regard to auditing, authentication, encryption, and other behaviors. On Linux and Windows hosts, the `postgresql.conf` file resides in the `data` directory under your EDB Postgres Extended Server installation.
66+
67+
Parameters that are preceded by a pound sign (#) are set to their default value. To change a parameter value, remove the pound sign and enter a new value. After setting or changing a parameter, you must either `reload` or `restart` the server for the new parameter value to take effect.
68+
69+
In the `postgresql.conf` file, some parameters contain comments that indicate `change requires restart`. To view a list of the parameters that require a server restart, use the following query at the psql command line:
70+
71+
```sql
72+
SELECT name FROM pg_settings WHERE context = 'postmaster';
73+
```
74+
75+
<div id="modifying_the_pg_hba_conf_file" class="registered_link"></div>
76+
77+
## Modifying the pg_hba.conf file
78+
79+
Appropriate authentication methods provide protection and security. Entries in the `pg_hba.conf` file specify the authentication methods that the server uses with connecting clients. Before connecting to the server, you might need to modify the authentication properties specified in the `pg_hba.conf` file.
80+
81+
When you invoke the initdb utility to create a cluster, the utility creates a `pg_hba.conf` file for that cluster that specifies the type of authentication required from connecting clients. You can modify this file. After modifying the authentication settings in the `pg_hba.conf` file, restart the server and apply the changes. For more information about authentication and modifying the `pg_hba.conf` file, see the [PostgreSQL core documentation](https://www.postgresql.org/docs/current/static/auth-pg-hba-conf.html).
82+
83+
When the server receives a connection request, it verifies the credentials provided against the authentication settings in the `pg_hba.conf` file before allowing a connection to a database. To log the `pg_hba.conf` file entry to authenticate a connection to the server, set the `log_connections` parameter to `ON` in the `postgresql.conf` file.
84+
85+
A record specifies a connection type, database name, user name, client IP address, and the authentication method to authorize a connection upon matching these parameters in the `pg_hba.conf` file. Once the connection to a server is authorized, you can see the matched line number and the authentication record from the `pg_hba.conf` file.
86+
87+
This example shows a log detail for a valid `pg_hba.conf` entry after successful authentication:
88+
89+
```shell
90+
2020-05-08 10:42:17 IST LOG: connection received: host=[local]
91+
2020-05-08 10:42:17 IST LOG: connection authorized: user=u1 database=edb
92+
application_name=psql
93+
2020-05-08 10:42:17 IST DETAIL: Connection matched pg_hba.conf line 84:
94+
"local all all md5"
95+
```
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: "Administration"
3+
indexCards: simple
4+
navigation:
5+
- 01_configuration_parameters
6+
---
7+
8+
EDB Postgres Extended Server includes features to help you to maintain, secure, and operate EDB Postgres Extended Server databases.
9+
10+
* [Setting Configuration Parameters](01_setting_configuration_parameters) covers how to configure GUC parameters at runtime, modifying `postgresql.conf` for persistent changes and editing `pg_hba.conf` to change access and authentication settings.
11+

product_docs/docs/pge/15/installing/linux_x86_64/pge_centos_7.mdx

Lines changed: 85 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,90 @@ Before you begin the installation process:
4040
## Install the package
4141

4242
```shell
43-
sudo yum -y install edb-postgresextended<xx>-server edb-postgresextended<xx>-contrib
43+
sudo yum -y install edb-postgresextended15-server edb-postgresextended15-contrib
4444
```
4545

46-
Where `<xx>` is the version of EDB Postgres Extended Server you are installing. For example, if you are installing version 15, the package name would be edb-postgresextended15-server edb-postgresextended15-contrib.
46+
## Initial configuration
47+
48+
Getting started with your cluster involves logging in, ensuring the installation and initial configuration was successful, connecting to your cluster, and creating the user password.
49+
50+
First, you need to initialize and start the database cluster. The `edb-pge-15-setup` script creates a cluster.
51+
52+
```shell
53+
sudo PGSETUP_INITDB_OPTIONS="-E UTF-8" /usr/edb/pge15/bin/edb-pge-15-setup initdb
54+
55+
sudo systemctl start edb-pge-15
56+
```
57+
58+
To work in your cluster, log in as the postgres user. Connect to the database server using the psql command-line client. Alternatively, you can use a client of your choice with the appropriate connection string.
59+
60+
```shell
61+
sudo -iu postgres
62+
63+
psql postgres
64+
```
65+
66+
The server runs with the `peer` or `ident` permission by default. You can change the authentication method by modifying the `pg_hba.conf` file.
67+
68+
Before changing the authentication method, assign a password to the database superuser, postgres. For more information on changing the authentication, see [Modifying the pg_hba.conf file](../../administration/01_setting_configuration_parameters/#modifying-the-pg_hbaconf-file).
69+
70+
```sql
71+
ALTER ROLE postgres with PASSWORD 'password';
72+
```
73+
74+
## Experiment
75+
76+
Now you're ready to create and connect to a database, create a table, insert data in a table, and view the data from the table.
77+
78+
First, use psql to create a database named `hr` to hold human resource information.
79+
80+
```sql
81+
# running in psql
82+
CREATE DATABASE hr;
83+
__OUTPUT__
84+
CREATE DATABASE
85+
```
86+
87+
Connect to the `hr` database inside psql:
88+
89+
```
90+
\c hr
91+
__OUTPUT__
92+
You are now connected to database "hr" as user "postgres".
93+
```
94+
95+
Create columns to hold department numbers, unique department names, and locations:
96+
97+
```
98+
CREATE TABLE public.dept (deptno numeric(2) NOT NULL CONSTRAINT dept_pk
99+
PRIMARY KEY, dname varchar(14) CONSTRAINT dept_dname_uq UNIQUE, loc
100+
varchar(13));
101+
__OUTPUT__
102+
CREATE TABLE
103+
```
104+
105+
Insert values into the `dept` table:
106+
107+
```
108+
INSERT INTO dept VALUES (10,'ACCOUNTING','NEW YORK');
109+
__OUTPUT__
110+
INSERT 0 1
111+
```
112+
113+
```
114+
INSERT into dept VALUES (20,'RESEARCH','DALLAS');
115+
__OUTPUT__
116+
INSERT 0 1
117+
```
118+
119+
View the table data by selecting the values from the table:
120+
121+
```
122+
SELECT * FROM dept;
123+
__OUTPUT__
124+
deptno | dname | loc
125+
--------+------------+----------
126+
10 | ACCOUNTING | NEW YORK
127+
20 | RESEARCH | DALLAS
128+
(2 rows)
129+
```

0 commit comments

Comments
 (0)