Skip to content

Commit 157bf3b

Browse files
authored
Merge branch 'develop' into docs/tpa/add-missing-rel-note
2 parents f66e4e7 + 254d50f commit 157bf3b

File tree

3,326 files changed

+147447
-52063
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,326 files changed

+147447
-52063
lines changed

.github/workflows/check-links.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: check links on PR
2+
on:
3+
pull_request:
4+
types: [opened, synchronize]
5+
jobs:
6+
check-links:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout repo
10+
uses: actions/checkout@v4
11+
with:
12+
lfs: true
13+
ref: ${{ github.event.pull_request.head.sha }}
14+
path: content
15+
sparse-checkout: |
16+
advocacy_docs
17+
product_docs
18+
19+
- name: Checkout sync tool
20+
uses: actions/checkout@v4
21+
with:
22+
lfs: true
23+
ref: develop
24+
path: tools
25+
sparse-checkout: |
26+
tools
27+
28+
- name: setup node
29+
uses: actions/setup-node@v4
30+
31+
- name: install dependencies
32+
run: npm --prefix ./tools/tools/automation/actions/link-check ci
33+
34+
- name: check links
35+
uses: ./tools/tools/automation/actions/link-check
36+
with:
37+
content-path: ./content

.vscode/launch.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "launch",
10+
"name": "Launch update links to renames",
11+
"skipFiles": [
12+
"<node_internals>/**"
13+
],
14+
"program": "${workspaceFolder}/tools/user/reorg/links/update-links-to-renames.js"
15+
},
16+
{
17+
"type": "node",
18+
"request": "launch",
19+
"name": "Launch link-check",
20+
"skipFiles": [
21+
"<node_internals>/**"
22+
],
23+
"program": "${workspaceFolder}/tools/automation/actions/link-check/index.js"
24+
}
25+
]
26+
}

CODEOWNERS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# First pass basic codeowners file
1+
# Second pass basic codeowners file
22

33
product_docs/docs/pgd/ @djw-m @jpe442 @piano35-edb
44
product_docs/docs/epas/ @nidhibhammar @gvasquezvargas
@@ -39,4 +39,5 @@ advocacy_docs/edb-postgres-ai/ @jpe442 @djw-m @gvasquezvargas
3939
advocacy_docs/supported-open-source/barman/ @piano35-edb @jpe442
4040
product_docs/docs/pge/ @gvasquezvargas
4141
advocacy_docs/supported-open-source/postgresql/ @piano35-edb
42+
* @EnterpriseDB/documentation-team
4243

advocacy_docs/community/contributing/styleguide.mdx

Lines changed: 83 additions & 57 deletions
Large diffs are not rendered by default.
Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
---
2+
title: Installing PostgreSQL in a Docker container on your local machine
3+
navTitle: Docker
4+
description: Learn how to install PostgreSQL in a Docker container on your local machine for development purposes.
5+
deepToC: true
6+
---
7+
8+
## Prerequisites
9+
10+
* Docker-compatible OS (macOS, Windows, Linux)
11+
12+
Using Docker for your local PostgreSQL development environment streamlines setup, ensures consistency, and simplifies management. It provides a flexible, isolated, and portable solution that can adapt to various development needs and workflows.
13+
14+
## Preparing Docker
15+
16+
### Install Docker:
17+
18+
Make sure Docker is installed on your machine or download and install it from [Docker’s official website](https://www.docker.com/products/docker-desktop/).
19+
20+
* macOS: Download and install Docker Desktop from Docker’s official website.
21+
* Windows: Download and install Docker Desktop from Docker’s official website. Ensure WSL 2 is enabled if using Windows 10 or later.
22+
* Linux: Install Docker using your distribution’s package manager. For example, on Ubuntu:
23+
24+
```
25+
sudo apt update
26+
sudo apt install docker.io
27+
sudo systemctl start docker
28+
sudo systemctl enable docker
29+
sudo usermod -ag docker $USER
30+
newgrp docker
31+
```
32+
33+
34+
### Pull the PostgreSQL Docker image:
35+
36+
Open a terminal or command prompt and run the following command to pull the latest PostgreSQL image from Docker Hub:
37+
38+
```
39+
docker pull postgres
40+
```
41+
42+
## Running the PostgreSQL container
43+
44+
Run a new container with the PostgreSQL image using the following command:
45+
46+
```
47+
docker run --name my_postgres -d postgres -e POSTGRES_PASSWORD=mysecretpassword -v my_pgdata:/var/lib/postgresql/data -p 5432:5432
48+
```
49+
50+
#### `--name my_postgres`
51+
52+
The `--name` flag tells docker to creates a new container named `my_postgres`.
53+
54+
#### `-d`
55+
56+
The `-d` flag tells Docker to run the container in detached mode. This means the container runs in the background and does not block the terminal.
57+
58+
#### `postgres`
59+
60+
This is the name of the image to run. Docker uses this name to pull the image from Docker Hub if it is not already present on the local machine. Note that if we had not pulled it, this command would automatically pull the PostgreSQL image.
61+
62+
#### `-e POSTGRES_PASSWORD=mysecretpassword`
63+
64+
The `-e` flag sets an environment variable `POSTGRES_PASSWORD` to `mysecretpassword`. This is used the password for the default `postgres` user. You should use a different password.
65+
66+
#### `-v my_pgdata:/var/lib/postgresql/data`
67+
Docker uses volumes to persist data in Docker containers. This flag mounts a volume named `my_pgdata` to persist data.
68+
The data in this case is whatever Postgres writes to the `/var/lib/postgresql/data` directory within the container.
69+
These writes are persisted outside the container in a docker volume; the command `docker volume inspect my_pgdata` will show you information about that volume.
70+
71+
#### `-p 5432:5432`
72+
73+
The `-p` flag maps the container’s port 5432 to the host machine’s port 5432. Port 5432 is Postgres's default port for communications. By using this flag, it allows you to access the PostgreSQL database from your host machine.
74+
75+
## Verifying the container is running
76+
77+
To verify that the container is running, use the following command:
78+
79+
```
80+
docker ps
81+
```
82+
83+
This command lists all running containers. You should see the `my_postgres` container listed.
84+
85+
You now have a persistent, locally accessible Postgres database running in a Docker container.
86+
You can now start using it.
87+
88+
## Access PostgreSQL with a client
89+
90+
To access the PostgreSQL database, without any additional tools, you can use the following command to open a PostgreSQL prompt:
91+
92+
```
93+
docker exec \-it my\_postgres psql \-U postgres
94+
```
95+
96+
This logs into the Docker container and runs the `psql` command as the `postgres` user from there.
97+
98+
The `psql` command is a powerful tool for interacting with PostgreSQL databases. You should install it on your local machine to interact with the PostgreSQL database running in the Docker container.
99+
100+
### macOS
101+
102+
You can install the PostgreSQL client using Homebrew:
103+
104+
```
105+
brew install libpq
106+
```
107+
108+
### Windows
109+
110+
Download the PostgreSQL client from the [official website](https://www.enterprisedb.com/downloads/postgres-postgresql-downloads).
111+
112+
### Linux
113+
114+
Use your distribution’s package manager to install the PostgreSQL client. For example, on Ubuntu:
115+
116+
```
117+
sudo apt-get install postgresql-client
118+
```
119+
120+
## Connecting other apps
121+
122+
You can also connect other applications to the PostgreSQL database running in the Docker container. You need to provide the following connection details:
123+
124+
* Host: `localhost`
125+
* Port: `5432`
126+
* Username: `postgres`
127+
* Password: (whatever you set it to)
128+
* Database: `postgres`
129+
130+
Or use the connection string:
131+
132+
```
133+
postgresql://postgres:mysecretpassword@localhost:5432/postgres
134+
```
135+
136+
## Verifying data persistence
137+
138+
1. Create a table and insert data.
139+
Access the PostgreSQL instance and run the following SQL commands to create a table with columns and insert some data:
140+
141+
```sql
142+
CREATE TABLE employees (
143+
id SERIAL PRIMARY KEY,
144+
first_name VARCHAR(50),
145+
last_name VARCHAR(50),
146+
email VARCHAR(100),
147+
hire_date DATE
148+
);
149+
INSERT INTO employees (first_name, last_name, email, hire_date) VALUES
150+
('John', 'Doe','[email protected]', '2020-01-15'),
151+
('Jane', 'Smith', '[email protected]', '2019-03-22');
152+
```
153+
154+
2. Stop and completely remove the container.
155+
```
156+
docker stop my_postgres
157+
docker rm my_postgres
158+
```
159+
160+
3. Recreate the container with the same volume.
161+
162+
```
163+
docker run --name my_postgres -d postgres -e POSTGRES_PASSWORD=mysecretpassword -v my_pgdata:/var/lib/postgresql/data -p 5432:5432
164+
```
165+
166+
4. Verify Data Persistence.
167+
Access the PostgreSQL instance and check if the data still exists:
168+
169+
```sql
170+
SELECT * FROM employees
171+
```
172+
173+
If everything worked as expected, you should see the employee table with the data previously loaded still present.
174+
175+
176+
## Stopping and removing the container
177+
178+
To stop and remove the container, use the following commands:
179+
180+
```
181+
docker stop my_postgres
182+
docker rm my_postgres
183+
```
184+
185+
## Deleting the volume
186+
187+
To remove the volume containing the database, use the following command (after stopping and removing the container):
188+
189+
```
190+
docker volume rm my_pgdata
191+
```
192+
193+
## Conclusion
194+
195+
By following these steps, you have set up a robust local development environment for PostgreSQL using Docker. This setup ensures data persistence and provides a flexible, isolated, and consistent environment for all of your development needs.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Deploying Postgres for developers
3+
navTitle: Deploying for developers
4+
description: How to deploy Postgres for developers.
5+
---
6+
7+

advocacy_docs/dev-guides/index.mdx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
title: The EDB Postgres AI Developer Guides
3+
navTitle: Developer Guides
4+
description: The EDB Postgres AI Developer Guides provide information on how to use the EDB Postgres AI platform to build and develop Postgres and AI applications.
5+
deepToC: true
6+
directoryDefaults:
7+
iconName: "CodeWriting"
8+
indexCards: simple
9+
prevNext: true
10+
navigation:
11+
- deploy
12+
- working
13+
---
14+
15+
The EDB Postgres AI Developer Guides are all about providing you, the developer, with the information you need to accelerate your development efforts using the EDB Postgres AI platform. The guides cover a wide range of topics, from setting up your development environment to deploying Postgres and AI applications.
16+
17+
## Deploying Postgres Locally for developers
18+
19+
* [Deploying Postgres Using Docker Locally](deploy/docker)
20+
21+
## Working with Postgres
22+
23+
* [PSQL for busy developers](working/psql-for-busy-developers)
24+
25+
<!-- ## Developing Postgres Applications
26+
27+
* [Developing Postgres Applications with Python](developing/developing-postgres-applications-with-python)
28+
-->
29+
30+
31+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: Working with Postgres tools - guides for developers
3+
navTitle: Working with tools
4+
description: How to work with a range of Postgres tools, with a focus on developers and debugging.
5+
---
6+

0 commit comments

Comments
 (0)