Skip to content

Commit

Permalink
Merge pull request #1256 from EnterpriseDB/release/2021-04-15
Browse files Browse the repository at this point in the history
Former-commit-id: d62a546
  • Loading branch information
robert-stringer committed Apr 15, 2021
2 parents 170d569 + 4c525aa commit c4d134f
Show file tree
Hide file tree
Showing 61 changed files with 214 additions and 194 deletions.
2 changes: 1 addition & 1 deletion advocacy_docs/kubernetes/cloud_native_postgresql/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ navigation:
- architecture
- installation
- quickstart
- interactive
- interactive_demo
- cloud_setup
- bootstrap
- resource_management
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ katacodaPanel:
scenario: minikube
codelanguages: shell, yaml
showInteractiveBadge: true
legacyRedirects:
- "/kubernetes/cloud_native_postgresql/interactive/installation_and_deployment"
---

Want to see what it takes to get the Cloud Native PostgreSQL Operator up and running? This section will demonstrate the following:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ using Cloud Native PostgreSQL on a local Kubernetes cluster in
!!! Tip "Live demonstration"
Don't want to install anything locally just yet? Try a demonstration directly in your browser:

[Cloud Native PostgreSQL Operator Interactive Quickstart](interactive/installation_and_deployment/)
[Cloud Native PostgreSQL Operator Interactive Quickstart](interactive_demo)

RedHat OpenShift Container Platform users can test the certified operator for
Cloud Native PostgreSQL on the [Red Hat CodeReady Containers (CRC)](https://developers.redhat.com/products/codeready-containers/overview)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The [installation](02-installation) procedure must be followed before proceeding

The default pgBackRest configuration file location is `/etc/pgbackrest/pgbackrest.conf`. If it does not exist, then `/etc/pgbackrest.conf` is used next.

For more information about configuration parameters, see the [appendix section](97-appendix#configuration-reference).
For more information about configuration parameters, see the [appendix section](98-appendix/#configuration-reference).

The following example configures a `demo` stanza to take a backup of a database cluster running on the local host.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,7 @@ TEXT REGEXP_SUBSTR
In the following simple example, `REGEXP_SUBSTR` searches a string that contains a phone number for the first set of three consecutive digits:

```text
edb=# SELECT REGEXP_SUBSTR('800-555-1212', '[0-9][0-9][0-9]', 1, 1) FROM
DUAL;
edb=# SELECT REGEXP_SUBSTR('800-555-1212', '[0-9][0-9][0-9]', 1, 1) FROM DUAL;
regexp_substr
---------------
800
Expand All @@ -211,8 +210,7 @@ DUAL;
It locates the first occurrence of three digits and returns the string `(800)`; if we modify the command to check for the second occurrence of three consecutive digits:

```text
edb=# SELECT REGEXP_SUBSTR('800-555-1212', '[0-9][0-9][0-9]', 1, 2) FROM
DUAL;
edb=# SELECT REGEXP_SUBSTR('800-555-1212', '[0-9][0-9][0-9]', 1, 2) FROM DUAL;
regexp_substr
---------------
555
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ string NOT LIKE pattern [ ESCAPE escape-character ]

Every `pattern` defines a set of strings. The `LIKE` expression returns `TRUE` if `string` is contained in the set of strings represented by `pattern`. As expected, the `NOT LIKE` expression returns `FALSE` if `LIKE` returns `TRUE`, and vice versa. An equivalent expression is `NOT (string LIKE pattern)`.

If `pattern` does not contain percent signs or underscore, then the pattern only represents the string itself; in that case `LIKE` acts like the equals operator. An underscore (\_) in `pattern` stands for (matches) any single character; a percent sign (`%`) matches any string of zero or more characters.
If `pattern` does not contain percent signs or underscore, then the pattern only represents the string itself; in that case `LIKE` acts like the equals operator. An underscore (`_`) in `pattern` stands for (matches) any single character; a percent sign (`%`) matches any string of zero or more characters.

Some examples:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,8 @@ CREATE INDEX
edb=# \dS ts_idx
Index "public.ts_idx"
Column | Type | Definition
---------+-------------------+----------------------------------------------
to_char | character varying | to_char(ts_col, 'YYYY-MM-DD
HH24:MI:SS'::character varying)
---------+-------------------+-----------------------------------------------------------
to_char | character varying | to_char(ts_col, 'YYYY-MM-DD HH24:MI:SS'::character varying)
btree, for table "public.ts_tbl"
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ In the date/time functions of the following table the use of the `DATE` and `TIM
| ------------------------------------------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------- |
| `ADD_MONTHS (DATE, NUMBER)` | `DATE` | Add months to a date | `ADD_MONTHS ('28-FEB-97', ,3.8)` | `31-MAY-97 00:00:00` |
| `CURRENT_DATE` | `DATE` | Current date | `CURRENT_DATE` | `04-JUL-07` |
| `CURRENT_TIME STAMP` | `TIMESTAMP` | Returns the current date and time | `CURRENT_TIME STAMP` | `04-JUL-07 15:33:23.484` |
| `CURRENT_TIMESTAMP` | `TIMESTAMP` | Returns the current date and time | `CURRENT_TIMESTAMP` | `04-JUL-07 15:33:23.484` |
| `EXTRACT(field FROM TIMESTAMP)` | `DOUBLE PRECISION` | Get subfield | `EXTRACT(hour FROM TIMESTAMP '2001-02-16 20:38:40')` | `20` |
| `LAST_DAY(DATE)` | `DATE` | Returns the last day of the month represented by the given date. If the given date contains a time portion, it is carried forward to the result unchanged | `LAST_DAY('14-APR-98')` | `30-APR-98 00:00:00` |
| `LOCALTIMESTAMP [ (precision) ]` | `TIMESTAMP` | Current date and time (start of current transaction) | `LOCALTIMESTAMP` | `04-JUL-07 15:33:23.484` |
Expand Down Expand Up @@ -637,8 +637,7 @@ Following are examples of usage of the `TRUNC` function.
The following example truncates down to the hundred years unit.

```text
SELECT TO_CHAR(TRUNC(TO_DATE('1951','YYYY'),'CC'),'DD-MON-YYYY') "Century"
FROM DUAL;
SELECT TO_CHAR(TRUNC(TO_DATE('1951','YYYY'),'CC'),'DD-MON-YYYY') "Century" FROM DUAL;
Century
-------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ CASE WHEN condition THEN result
END
```

`CASE` clauses can be used wherever an expression is valid. `condition` is an expression that returns a `BOOLEAN` result. If the result is `TRUE` then the value of the `CASE` expression is the `result` that follows the condition. If the result is `FALSE` any subsequent `WHEN` clauses are searched in the same manner. If `no WHEN condition` is `TRUE` then the value of the `CASE` expression is the `result` in the `ELSE` clause. If the `ELSE` clause is omitted and no condition matches, the result is `null`.
`CASE` clauses can be used wherever an expression is valid. `condition` is an expression that returns a `BOOLEAN` result. If the result is `TRUE` then the value of the `CASE` expression is the `result` that follows the condition. If the result is `FALSE` any subsequent `WHEN` clauses are searched in the same manner. If `no WHEN condition` is `TRUE` then the value of the `CASE` expression is the `result` in the `ELSE` clause. If the `ELSE` clause is omitted and no condition matches, the result is `NULL`.

An example:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ The `LISTAGG` function returns a string value.

**Examples**

The following example concatenates the values in the `EMP` table and lists all the employees separated by a `delimiter` comma.
The following example concatenates the values in the `emp` table and lists all the employees separated by a `delimiter` comma.

First, create a table named `EMP` and then insert records into the `EMP` table.
First, create a table named `emp` and then insert records into the `emp` table.

```text
edb=# CREATE TABLE EMP
edb=# CREATE TABLE emp
edb-# (EMPNO NUMBER(4) NOT NULL,
edb(# ENAME VARCHAR2(10),
edb(# JOB VARCHAR2(9),
Expand All @@ -106,39 +106,39 @@ CREATE TABLE
```

```text
edb=# INSERT INTO EMP VALUES
edb=# INSERT INTO emp VALUES
edb-# (7499, 'ALLEN', 'SALESMAN', 7698,
edb(# TO_DATE('20-FEB-1981', 'DD-MON-YYYY'), 1600, 300, 30);
INSERT 0 1
edb=# INSERT INTO EMP VALUES
edb=# INSERT INTO emp VALUES
edb-# (7521, 'WARD', 'SALESMAN', 7698,
edb(# TO_DATE('22-FEB-1981', 'DD-MON-YYYY'), 1250, 500, 30);
INSERT 0 1
edb=# INSERT INTO EMP VALUES
edb=# INSERT INTO emp VALUES
edb-# (7566, 'JONES', 'MANAGER', 7839,
edb(# TO_DATE('2-APR-1981', 'DD-MON-YYYY'), 2975, NULL, 20);
INSERT 0 1
edb=# INSERT INTO EMP VALUES
edb=# INSERT INTO emp VALUES
edb-# (7654, 'MARTIN', 'SALESMAN', 7698,
edb(# TO_DATE('28-SEP-1981', 'DD-MON-YYYY'), 1250, 1400, 30);
INSERT 0 1
edb=# INSERT INTO EMP VALUES
edb=# INSERT INTO emp VALUES
edb-# (7698, 'BLAKE', 'MANAGER', 7839,
edb(# TO_DATE('1-MAY-1981', 'DD-MON-YYYY'), 2850, NULL, 30);
INSERT 0 1
edb=# SELECT LISTAGG(ENAME, ',') WITHIN GROUP (ORDER BY ENAME) FROM EMP;
edb=# SELECT LISTAGG(ENAME, ',') WITHIN GROUP (ORDER BY ENAME) FROM emp;
listagg
-------------------------------------
ALLEN,BLAKE,JONES,MARTIN,WARD
(1 row)
```

The following example uses `PARTITION BY` clause with `LISTAGG` in `EMP` table and generates output based on a partition by `DEPTNO` that applies to each partition and not on the entire table.
The following example uses `PARTITION BY` clause with `LISTAGG` in `emp` table and generates output based on a partition by `deptno` that applies to each partition and not on the entire table.

```text
edb=# SELECT DISTINCT DEPTNO, LISTAGG(ENAME, ',') WITHIN GROUP (ORDER BY
ENAME) OVER(PARTITION BY DEPTNO) FROM EMP;
ENAME) OVER(PARTITION BY DEPTNO) FROM emp;
deptno | listagg
--------+-------------------------
30 | ALLEN,BLAKE,MARTIN,WARD
Expand All @@ -150,7 +150,7 @@ The following example is identical to the previous example, except it includes t

```text
edb=# SELECT DEPTNO, LISTAGG(ENAME, ',') WITHIN GROUP (ORDER BY ENAME) FROM
EMP GROUP BY DEPTNO;
emp GROUP BY DEPTNO;
deptno | listagg
--------+-------------------------
20 | JONES
Expand Down Expand Up @@ -201,10 +201,10 @@ The return type is determined by the input data type of `expression`. The follow

**Examples**

In the following example, a query returns the median salary for each department in the `EMP` table:
In the following example, a query returns the median salary for each department in the `emp` table:

```text
edb=# SELECT * FROM EMP;
edb=# SELECT * FROM emp;
empno| ename | job | mgr | hiredate | sal | comm | deptno
-----+-------+---------+------+-------------------+--------+--------+-------
7369 | SMITH | CLERK | 7902 | 17-DEC-80 00:00:00| 800.00| | 20
Expand All @@ -214,18 +214,18 @@ edb=# SELECT * FROM EMP;
7654 | MARTIN| SALESMAN| 7698 | 28-SEP-81 00:00:00| 1250.00| 1400.00| 30
(5 rows)
edb=# SELECT MEDIAN (SAL) FROM EMP;
edb=# SELECT MEDIAN (SAL) FROM emp;
median
--------
1250
(1 row)
```

The following example uses `PARTITION BY` clause with `MEDIAN` in `EMP` table and returns the median salary based on a partition by `DEPTNO`:
The following example uses `PARTITION BY` clause with `MEDIAN` in `emp` table and returns the median salary based on a partition by `deptno`:

```text
edb=# SELECT EMPNO, ENAME, DEPTNO, MEDIAN (SAL) OVER (PARTITION BY DEPTNO)
FROM EMP;
FROM emp;
empno | ename | deptno | median
-------+--------+--------+--------
7369 | SMITH | 20 | 1887.5
Expand All @@ -240,7 +240,7 @@ The `MEDIAN` function can be compared with `PERCENTILE_CONT`. In the following e

```text
edb=# SELECT MEDIAN (SAL), PERCENTILE_CONT(0.5) WITHIN GROUP(ORDER BY SAL)
FROM EMP;
FROM emp;
median | percentile_cont
--------+-----------------
1250 | 1250
Expand Down Expand Up @@ -281,10 +281,10 @@ The `STATS_MODE` function returns a value that appears frequently. However, if a

**Examples**

The following example returns the mode of salary in the `EMP` table:
The following example returns the mode of salary in the `emp` table:

```text
edb=# SELECT * FROM EMP;
edb=# SELECT * FROM emp;
empno| ename | job | mgr | hiredate | sal | comm | deptno
------+-------+---------+------+-------------------+--------+--------+-------
7369 | SMITH | CLERK | 7902 | 17-DEC-80 00:00:00| 800.00| | 20
Expand All @@ -294,17 +294,17 @@ edb=# SELECT * FROM EMP;
7654 | MARTIN| SALESMAN| 7698 | 28-SEP-81 00:00:00| 1250.00| 1400.00| 30
(5 rows)
edb=# SELECT STATS_MODE(SAL) FROM EMP;
edb=# SELECT STATS_MODE(SAL) FROM emp;
stats_mode
------------
1250.00
(1 row)
```

The following example uses `GROUP BY` and `ORDER BY` clause with `STATS_MODE` in `EMP` table and returns the salary based on a partition by `DEPTNO`:
The following example uses `GROUP BY` and `ORDER BY` clause with `STATS_MODE` in `emp` table and returns the salary based on a partition by `deptno`:

```text
edb=# SELECT STATS_MODE(SAL) FROM EMP GROUP BY DEPTNO ORDER BY DEPTNO;
edb=# SELECT STATS_MODE(SAL) FROM emp GROUP BY DEPTNO ORDER BY DEPTNO;
stats_mode
------------
800.00
Expand All @@ -315,7 +315,7 @@ edb=# SELECT STATS_MODE(SAL) FROM EMP GROUP BY DEPTNO ORDER BY DEPTNO;
The following example uses the `WITHIN GROUP` clause with the `STATS_MODE` function to perform aggregation on the ordered data set.

```text
SELECT STATS_MODE() WITHIN GROUP(ORDER BY SAL) FROM EMP;
SELECT STATS_MODE() WITHIN GROUP(ORDER BY SAL) FROM emp;
stats_mode
------------
1250.00
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ The `edb_profile` table stores information about the available profiles. `edb_pr

The `edb_variable` table contains one row for each package level variable (each variable declared within a package).

| Column | Type | Modifiers | Description |
| ------------ | ---------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `varname` | `"name"` | `not null` | The name of the variable. |
| `varpackage` | `oid` | `not null` | The `OID` of the `pg_namespace` row that stores the package. |
| `vartype` | `oid` | `not null` | The `OID` of the `pg_type` row that defines the type of the variable. |
| `varaccess` | `"char"` | `not null` | + if the variable is visible outside of the package. - if the variable is only visible within the package. Note: Public variables are declared within the package header; private variables are declared within the package body. |
| `varsrc` | `text` | `not null` | Contains the source of the variable declaration, including any default value expressions for the variable. |
| `varseq` | `smallint` | `not null` | The order in which the variable was declared in the package. |
| Column | Type | Modifiers | Description |
| ------------ | ---------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `varname` | `"name"` | `not null` | The name of the variable. |
| `varpackage` | `oid` | `not null` | The `OID` of the `pg_namespace` row that stores the package. |
| `vartype` | `oid` | `not null` | The `OID` of the `pg_type` row that defines the type of the variable. |
| `varaccess` | `"char"` | `not null` | `+` if the variable is visible outside of the package. `-` if the variable is only visible within the package. Note: Public variables are declared within the package header; private variables are declared within the package body. |
| `varsrc` | `text` | | Contains the source of the variable declaration, including any default value expressions for the variable. |
| `varseq` | `smallint` | `not null` | The order in which the variable was declared in the package. |

## pg_synonym

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ALTER TABLE sales SET AUTOMATIC;
Query the `ALL_TAB_PARTITIONS` view to see that an existing partition is successfully created.

```text
edb=# select table_name, partition_name, high_value FROM ALL_TAB_PARTITIONS;
edb=# SELECT table_name, partition_name, high_value FROM ALL_TAB_PARTITIONS;
table_name | partition_name | high_value
------------+----------------+------------
SALES | P_KAN | 'KANSAS'
Expand All @@ -53,7 +53,7 @@ INSERT 0 1
Then, query the `ALL_TAB_PARTITIONS` view again after the insert. The automatic list partition is successfully created and data is inserted. A system-generated name of the partition is created that varies for each session.

```text
edb=# select table_name, partition_name, high_value FROM ALL_TAB_PARTITIONS;
edb=# SELECT table_name, partition_name, high_value FROM ALL_TAB_PARTITIONS;
table_name | partition_name | high_value
------------+----------------+------------
SALES | P_KAN | 'KANSAS'
Expand Down
Loading

0 comments on commit c4d134f

Please sign in to comment.