Compare commits

..

2 commits

Author SHA1 Message Date
b574e9f07b
Postgresql page 2022-08-22 18:43:36 +02:00
c519755ae9
Initial config 2022-08-22 18:43:21 +02:00
3 changed files with 93 additions and 3 deletions

View file

@ -1,4 +1,11 @@
baseURL = 'http://example.org/' baseURL = 'https://doc.edgarpierre.fr/'
languageCode = 'en-us' languageCode = 'fr-fr'
title = 'My New Hugo Site' title = 'Edoceo'
theme = 'hugo-book' theme = 'hugo-book'
enableGitInfo = true
[params]
BookLogo = 'logo.svg'
BookRepo = 'https://git.edgarpierre.fr/edpibu/blog'
BookDateFormat = 2006-01-02
BookComments = false

View file

@ -0,0 +1,51 @@
---
title: "Postgresql"
weight: 1
# bookFlatSection: false
# bookToc: true
# bookHidden: false
# bookCollapseSection: false
# bookComments: false
# bookSearchExclude: false
---
# Postgresql
*On this page, `$` means the command must be run as a user with adequate rights such as the `postgresql` user.*
## Filesystem preparation
In case a Btrfs filesystem is used, Copy-on-Write should be disabled first.
## Initial setup
The database can be initialized using the following command. Locale defaults to current environment locale.
```
$ initdb --locale C.UTF-8 --encoding=UTF8 -D /var/lib/postgres/data --data-checksums
```
Postgresql can then be started using the `postgresql` systemd service.
## Usage
### Creating users
The following command can be used:
```
$ createuser [--interactive]
```
Additionnal options can be used to give permissions to the user (usually not needed).
Users can be deleted using the following command:
```
$ dropuser [-i/--interactive] [user]
```
### Creating databases
The following command can be used:
```
$ createdb [-O owner] [dbname [description]]
```
## Sources
1. <https://wiki.archlinux.org/title/PostgreSQL>

32
static/logo.svg Normal file
View file

@ -0,0 +1,32 @@
<svg version="1.1"
width="100"
height="100"
xmlns="http://www.w3.org/2000/svg">
<defs>
<rect id="basemask" x="0" y="0" width="100" height="100" />
<path id="goa" d="M 60 40
Q 80 45 75 55
Q 75 50 55 50" transform="translate(8 0)" />
<path id="gob" d="M 10,100
v -50
a 25 25 0 0 1 25 -25
c 10 0 20 12 25 15
l -5 10
C 30 50 40 55 45 100" transform="translate(8 0)" />
</defs>
<mask id="mask">
<use href="#basemask" fill="black" />
<circle cx="50" cy="50" r="50" fill="white" />
</mask>
<mask id="mask-go">
<use href="#basemask" fill="white" />
<use href="#goa" fill="black" />
<use href="#gob" fill="black" />
</mask>
<circle cx="50" cy="50" r="50" fill="black" mask="url(#mask-go)" />
<use href="#goa" fill="#8ac149" mask="url(#mask)" />
<use href="#gob" fill="white" mask="url(#mask)" />
</svg>

After

Width:  |  Height:  |  Size: 847 B