Skip to content

Commit 69b2ef6

Browse files
committed
Documenting pg 03 and fixing typos on 01 and 02
1 parent 1806848 commit 69b2ef6

14 files changed

+191
-33
lines changed

src/en/01_introduction.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ PgManage’s interface allows to quickly switch between database sessions throug
2323
- Mac OSX
2424

2525
> **Note:** PgManage currently only supports x86_64 architecture. ARM64 support may be added in the future.
26+
2627
> **Note:** Only Windows 10 and higher versions are supported
28+
2729
## Credits
2830

2931
- [OmniDB](https://github.com/OmniDB/OmniDB)

src/en/02_quick_start.md

Lines changed: 78 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ Download the PgManage distribution file for your platform from the [Command Prom
88

99
### Linux
1010

11-
PgManage for Linux is packaged in `.AppImage` format and does not require installation.
12-
Download PgManage .AppImage file, in the command line change to the directory containing the downloaded file, make it executable, and run it:
11+
PgManage for Linux is packaged in `.AppImage` format and does not require installation. Download PgManage's `.AppImage` file. Then, in the command line, change to the directory containing the downloaded file, make it executable, and run it:
1312

1413
```
1514
chmod +x ./pgmanage-$version.AppImage
@@ -18,28 +17,91 @@ chmod +x ./pgmanage-$version.AppImage
1817

1918
### Windows
2019

21-
Run the PgManage setup executable and follow the installation instructions.
20+
- Run the PgManage setup executable and follow the installation instructions.
21+
- To install PostgreSQL client utilities, follow the steps in the [Installing Client Utilities on Windows](#installing-client-utilities-on-windows) section.
2222

2323
### Mac
2424

2525
Download the `DMG` file and double click on it and drag the PgManage icon to the `Applications Folder` icon.
2626

27-
### Oracle Support
27+
**FIXME:** add PostgreSQL command line tools installation instructions
2828

29-
A note about extra dependencies for Oracle support.
29+
---
30+
31+
### PostgreSQL Client
32+
33+
When PgManage starts, it will try to automatically find PostgreSQL's client executable files for the `pg_dump`, `pg_restore`, `pg_dumpall`, and `psql` commands. For cases in which this autodiscovery does not work or is not desired, a path to the binaries may be specified on the application’s `Utilities Menu → Settings`.
34+
35+
![Image of the settings dialog](./images/pgmanage-settings.png)
36+
37+
To check that the binaries were found, you may click the `validate` button which will display the installed PostgreSQL’s version.
38+
39+
![Image of the confirmation message](./images/pgmanage-validate.png)
40+
41+
> **Note:** The autodiscovery of client binaries is not available on Windows. The only way to use the backup and restore features is to manually install the PostgreSQL client utilities.
42+
43+
#### Installing Client Utilities on Windows
44+
45+
- You may download a Windows’ PostgreSQL installer from [enterprisedb.com](https://www.enterprisedb.com/downloads/postgres-postgresql-downloads).
46+
- Take note of the installation path where the components will be installed.
47+
48+
![Image of the PostgreSQL installer asking for an installation path](./images/edb_windows_psql_installer1.png)
49+
50+
- The installer will ask what components to install. Only install the `command line tools`.
51+
52+
![Image of the PostgreSQL installer asking what components to install](./images/edb_windows_psql_installer2.png)
53+
54+
- Finally, add the path to the binaries in the PgManage’s `Utilities Menu → Settings`. Notice that the binary files are inside the `bin` folder.
55+
56+
![Image of the settings dialog](./images/pgmanage_windows_binaries_validation.png)
57+
58+
#### Installing Client Utilities on Linux:
59+
60+
Setting up paths to PostgreSQL client binaries is not necessary for Linux systems because these will be automatically discovered in the $PATH environment variable. Still, there are some cases in which the path autodiscovery may fail:
61+
62+
- if multiple versions of the PostgreSQL client binaries are installed
63+
64+
- if the PostgreSQL client binaries are installed in a location not included in the $PATH environment variable
3065

31-
### Postgresql Client
32-
While being self-contained application for the majority of features, pgmanage relies on postgresql command line tools to perform database backup and restore operations.
66+
Once you have installed your preferred PostgreSQL’s version, add the path of the binaries in `Utilities Menu → Settings`.
3367

34-
TODO: add installation guide for various linux distros, windows and osx\
35-
TODO: add note about extra dependencies for Oracle support.
68+
> **Note:** You may install PostgreSQL for your particular Linux distribution on [postgresql.org](https://www.postgresql.org/download/linux/).
3669
70+
#### Installing Client Utilities on Mac
71+
72+
To install the client binaries in MacOS, there are two options: to install the complete Postgres packages or to only install libpq and then update the PATH.
73+
74+
To install the complete Postgres’s packages run the following command:
75+
76+
```
77+
brew install postgresql@[Major version]
78+
```
79+
80+
To install only the binaries and update the PATH variable, run the following commands:
81+
82+
```
83+
brew install libpq
84+
echo 'export PATH="/usr/local/opt/libpq/bin:$PATH"' >> ~/.zshrc
85+
```
86+
87+
Once you have installed your preferred Postgres version, add the path to the binaries in `Utilities Menu → Settings`.
88+
89+
> **Note:** For more information on how to install Postgres on Mac, refer to [Postgres' documentation](https://www.postgresql.org/download/macosx/).
90+
91+
---
92+
93+
### Oracle Support
94+
95+
A note about extra dependencies for Oracle support.
96+
97+
---
3798

3899
## Launching the App
39100

40101
When the application starts for the first time, it will prompt a message to set up a master password. Fill up the provided fields and press `Set master password`.
102+
This password will be requested the next time you open the application but you may reset it with a `Reset Master Password` button.
41103

42-
This password will be requested the next time you open the application but you may reset it with a “Reset Master Password” button.
104+
>**Note:** resetting the master password will erase all the information that was encrypted with it, including database connection credentials.
43105
44106
![Setting up the master password](./images/master_pass.png)
45107

@@ -64,22 +126,21 @@ PgManage stores sensitive data, such as database access credentials and SSH keys
64126
---
65127

66128
## Creating your first DB connection
129+
67130
Click on the ⚡ icon on the left sidebar, the connection management UI will be shown:
68-
![Connection Management](./images/connection_mgr.png)
131+
132+
![Connection Management](./images/connection_mgr.png)
69133

70-
Connections and Connection Groups are shown on the left, clicking on the left panel items shows the item's view/edit form.
134+
Connections and Connection Groups are shown on the left. Clicking on the left panel items shows the items view/edit form. Click on `➕ Add → Connection`. Set the connection title and database type; the rest of the form will change depending on the database type selected. Fill in the rest of the database connection properties.
71135

72-
Click the `➕ Add` button, select Connection
73-
Set connection title and database type, the rest of the form will change depending on the database type selected.
74-
Fill in the rest of database connection properties.
75-
**Note:** Alternatively the connection string may be used to establish a database connection.
136+
> **Note:** Alternatively, the connection string may be used to establish a database connection.
76137
77138
There are two special connection types, which behave differently:
78139

79140
- **SQLite connections** do not need any other settings besides the sqlite3 file path.
80141
- **Terminal connections** are shell/console sessions with a remote host. These require setting SSH properties.
81142

82-
> **Note:** the password field is optional. If you leave it empty, the password prompt will be shown each time before establishing the connection. For PostgreSQL connections, PgManage will also try to retrieve the connection password from the `.pgpass` file, unless the connection properties are provided in connection string form.
143+
> **Note:** the password field is optional. If you leave it empty, the password prompt will be shown each time before establishing the connection. For PostgreSQL connections, PgManage will also try to retrieve the connection password from the `.pgpass` file.
83144
84145
### SSH Tunnelling
85146

src/en/03_user_guide.md

Lines changed: 111 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,38 @@ The **context menus** can be accessed by right-clicking on one of the tree nodes
1616

1717
The actions available depend on the selected database object. Here is a list of command actions on alphabetical order:
1818

19-
- **Alter/edit:** opens a query tab with a template to change the given object.
20-
**TODO**: replace the above with a description of the new Table Editor functionality, same applies to "Create Table". The editor is available via Tables node->right click->Create Table OR by right clicking on the table node->table actions->alter table
19+
- **Alter/edit:** opens a new tab with an interface to alter the given object. For example, a table may be altered by right-clicking on the table object and selecting `Table Actions → Alter Table`. From there, you may do the following:
20+
- Change a field by double-clicking
21+
- Add a column with the `Add Column` button
22+
- Remove a column with the `❌ icon` at the end of each row
23+
- Check the generated query under the `Generated SQL`
24+
- Execute the generated query with the `Apply Changes` button.
25+
26+
![Alter table interface](./images/alter_table.png)
2127

2228
- **Analyze Table:** opens a query tab with a template for the [ANALYZE](https://www.postgresql.org/docs/current/sql-analyze.html) action.
23-
- **Create:** opens a query tab with a template to create the given object.
29+
- **Create:** opens a new tab with an interface to create the given object. For example, a table may be created by right-clicking on the `Tables` object and selecting `Create Table`. From here you may do the following:
30+
- change the table name
31+
- change the assigned schema
32+
- edit the columns by double-clicking on the fields
33+
- add a column with the `Add Column` button
34+
- remove a column with the `❌ icon` at the end of each line.
35+
- move a given column up or down with the arrows at the end of each line
36+
- check the generated query under the `Generated SQL` field.
37+
- execute the generated query with the `Apply Changes` button.
38+
39+
![Create table interface](./images/create_table.png)
40+
2441
- **Drop/Delete:** deletes the selected object from the server.
2542
- **Monitoring:** the dashboard or the backends may be selected to be opened on a new tab.
2643
- **Refresh:** refreshes the selected object.
2744
- **Reindex:** opens a query tab with a template for the [REINDEX](https://www.postgresql.org/docs/current/sql-reindex.html) action.
28-
- **Render Graph:** creates the graph of tables inside the database. It can generate a simple graph or a complete graph.
29-
**TODO**: ^^^ this feature was replaced with ER Diagram menu item.
45+
- **Render Graph:** opens a tab with an Entity Relationship diagram. This feature is available by right-clicking one of the schema objects and selecting `ER Diagram`. From there, you may:
46+
- move the tables by clicking and dragging
47+
- click on the name of a foreign key to highlight the table's relation with another.
48+
49+
![Entity Relationship diagram with a hilighted foreighn key](./images/erd.png)
50+
3051
- **Server Configuration:** opens the Server Configuration settings tab.
3152
- **Truncate Table:** opens a query tab with a template for the [TRUNCATE](https://www.postgresql.org/docs/current/sql-truncate.html) action.
3253
- **Update Records:** opens a query tab with a template for the [UPDATE](https://www.postgresql.org/docs/current/sql-update.html) action.
@@ -148,28 +169,50 @@ One may return to a previous configuration snapshot by selecting the snapshot fr
148169

149170
## PostgreSQL Extension Management
150171

151-
PostgreSQL Extensions can be managed via dedicated dialog accessible by right clicking Extensions node and its subnodes in the DB Object Tree
152-
**TODO**: Add detailed documentation and screenshot
172+
PostgreSQL Extensions can be managed via the dedicated dialog accessible by right-clicking the `Extensions` node and its subnodes in the DB Object Tree.
173+
174+
When the `Extensions` node is right-clicked, the following menu will be displayed:
175+
176+
![Extensions node with menu](./images/extensions0.png)
177+
178+
By clicking `Create Extension UI` a menu will open with a user interface, allowing to enter the extension name, a comment, a schema, and a version. A preview of the created query will be displayed under "Preview":
179+
180+
![Create Extension menu](./images/create_extension.png)
181+
182+
Right-clicking on a given extension will display a menu with the following options:
183+
184+
- **Alter Extension UI:** The `Alter Extension UI` option will open a user interface to create an `ALTER EXTENSION` query. This displays the following fields: the name of the extension, a comment, the schema, the version, and the query's preview.
185+
186+
![Alter Extension menu](./images/alter_extension.png)
187+
188+
- **Alter Extension:** Displays a template on a new tap with an `ALTER EXTENSION` query.
189+
190+
- **Edit Comment:** Displays a template on a new tap with a `COMMENT ON EXTENSION` query.
191+
192+
- **Drop Extension UI:** The `Drop Extension UI` will open a prompt confirming if the given extension should be dropped. Cascading can be enabled if desired.
193+
194+
![Drop Extension menu](./images/drop_extension.png)
195+
196+
- **Drop Extension:** Displays a template on a new tap with a `DROP EXTENSION` query.
153197

154198
---
155199

156200
## Data Editor Grid
157-
**TODO**: document the new Data Editor tab here, remove old data editor instructions below.
158201

159202
The data editor grid allows editing data of a specified query in a visual format. This feature can be accessed by right-clicking on a table in the DB entity tree.
160203

161204
![Image illustrating how to access the data editor grid](./images/edit_data_light.png)
162205

163-
Then, a new tab will be created with a default query of `select * from mytable t`. A text editor allows to add further conditions to the query.
206+
Then, a new tab will be created with the data editor. By default, the first 10 rows of the `SELECT * from [table] ORDER BY t.id` query will be displayed. A text field allows to change the query's conditions.
164207

165-
![Image showing the data grid tab](./images/edit_data_light1.png)
208+
![Image showing the data grid tab](./images/data_editor0.png)
166209

167210
The data editor grid allows the following changes:
168-
- **Delete a row:** Click on the `❌ icon` and the selected rows will become red.
169-
- **Edit cells:** Double click on a data cell to edit the grid. Or, `right-click → Edit Content` to open a separate editor.
170-
- **Displayed rows:** Click on the `Query Rows` dropdown-menu and select the number of desired rows.
211+
- **Delete a row:** Click on the `❌ icon` next to a row and it will become red. You may deselect the row with the going back icon next to the row.
212+
- **Edit cells:** Double-click on a data cell to edit the grid.
213+
- **Displayed rows:** Click on the `Limit` dropdown menu and select the number of desired rows.
171214

172-
Once the desired changes are done, click on the `Save` button.
215+
Once the desired changes are done, click on the `Apply changes` button.
173216

174217
---
175218

@@ -209,7 +252,18 @@ The different backup/restore jobs will be displayed under the `Jobs` section. He
209252
Under the `Actions` column, you may view details about a specific job or delete the job. The information about the job will contain the executed command, the start time, the duration of execution, and the output.
210253

211254
> **Note:** The backup and restore features run in the background, allowing you to navigate outside of the current tab without pausing the process.
212-
**TODO**: add note about the new PIGZ compression support and how to configure it (in app settings dialog)
255+
256+
### PIGZ Support
257+
PIGZ compression is now available for Linux. If desired, PIGZ needs to be installed on the target OS. For example, in Ubuntu, you may install it as follows:
258+
259+
```
260+
sudo apt update -y
261+
sudo apt install -y pigz
262+
```
263+
Next, the path to the PIGZ binaries needs to be specified in PgManage. If PIGZ is installed, the path may be added in the `Utilities Menu → Settings → Options → Pigz Binary Path`.
264+
265+
![Settings menu with the PIGZ's path field](./images/settings_options.png)
266+
213267
### Backup
214268

215269
PgManage allows you to create backups for a database or the whole server. The database backups can be `custom`, `.tar`, `plain`, or `directory`. The only format supported for server backups is `plain`.
@@ -235,6 +289,47 @@ Once the general information is filled out the `Revert Settings`, `Preview`, and
235289
- **Restore:** executes the restore commands as indicated in the form.
236290

237291
---
238-
### Extras
292+
## pg_cron GUI Instructions
293+
294+
First, install pg_cron in your target OS. For example, in Ubuntu, you may install it as follows:
295+
296+
```
297+
sudo apt-get -y install postgresql-[postgres version]-cron
298+
```
299+
300+
Next, add pg_cron to `shared_preload_libraries` in postgresql.conf. To do this change the following parameter:
301+
302+
```
303+
shared_preload_libraries = 'pg_cron'
304+
```
305+
306+
> **Note:** to get the path to your postgresql.conf file you may run the following query: `SHOW config_file;` To get the path to your pg_hba.conf file run the following query: `SHOW hba_file;`
307+
308+
Restart the postgres service so that the changes in the configuration take effect:
309+
310+
```
311+
sudo systemctl restart postgresql-[version].service
312+
```
313+
314+
Then, the pg_cron functions and metadata tables can be created. In the postgres shell run the following as super user:
315+
316+
```
317+
CREATE EXTENSION pg_cron;
318+
```
319+
320+
To ensure that pg_cron can start jobs, libpg needs permission to open a connection to the local database. This can be done by enabling `trust` authentication for connections coming from localhost. In your `pg_hba.conf` file, add the following line under "IPv4 local connections":
321+
```
322+
host all all 0.0.0.0/0 md5
323+
```
324+
325+
Add the following line at the end of the `pg_hba.conf` file to allow connections from all hosts:
326+
```
327+
hostssl all all 0.0.0.0/0 md5
328+
```
329+
330+
> **Note:** for more information on installing and setting up a cron extention, visit [pg_cron's GitHub repository](https://github.com/citusdata/pg_cron)
331+
332+
Now, PgManage should display the `jobs` node under the database node.
333+
239334
**TODO:** add detailed pg_cron GUI instructions
240335
brief:install pg_cron extension via extension manager. the "jobs" node should appear under the database node. right click-> new job

src/en/images/alter_extension.png

29.7 KB
Loading

src/en/images/alter_table.png

109 KB
Loading

src/en/images/create_extension.png

42.2 KB
Loading

src/en/images/create_table.png

65.4 KB
Loading

src/en/images/data_editor0.png

37.9 KB
Loading

src/en/images/drop_extension.png

14.8 KB
Loading

src/en/images/edit_data_light1.png

-66.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)