|
|
|
## Vydumpovani databaze do sql skriptu
|
|
|
|
|
|
|
|
```docker exec -t <container-name> pg_dumpall -U root > dump_`date +%Y-%m-%d"_"%H_%M_%S`.sql```
|
|
|
|
- pro vytvoreni nove db je treba **odstranit** vytvoreni role, tedy:
|
|
|
|
```CREATE ROLE root;```
|
|
|
|
|
|
|
|
## Nastaveni implicitniho pretypovavani integer -> boolean
|
|
|
|
aby se daly pouzivat cisla `1/0` misto `true/false`:
|
|
|
|
|
|
|
|
```update pg_cast set castcontext='a' where castsource = 'int4'::regtype and casttarget = 'boolean'::regtype;```
|
|
|
|
|
|
|
|
Nasledne zruseni:
|
|
|
|
|
|
|
|
```update pg_cast set castcontext='e' where castsource = 'int4'::regtype and casttarget = 'boolean'::regtype;``` |
|
|
|
\ No newline at end of file |