muerwre.github.io/sql/postgress-setup/_payload.js
muerwre 178a904adc commit db7ac717d3ca823f51df7d2087bb9fbf94e2fb95
Author: Fedor Katurov <gotham48@gmail.com>
Date:   Thu Nov 3 11:29:19 2022 +0600

    fixed proportions
2022-11-03 05:30:56 +00:00

1 line
No EOL
18 KiB
JavaScript

export default (function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,_,$,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao){return {data:{navigation:[{title:"Blockchain",_path:"\u002Fblockchain",children:[{title:"Common Typescript Examples",_path:"\u002Fblockchain\u002Fcommon-typescript-examples"},{title:"Smart Contracts",_path:"\u002Fblockchain\u002Fsmart-contracts"}]},{title:"Css",_path:"\u002Fcss",children:[{title:"Automatic Grid Like Masonry With Pure CSS",_path:"\u002Fcss\u002Fautomatic-grid-like-masonry-with-pure-css"},{title:"Sass Nth Child Iterate Mixin",_path:"\u002Fcss\u002Fsass-nth-child-iterate-mixin"},{title:"Test If Browser Supports CSS Rules",_path:"\u002Fcss\u002Ftest-if-browser-supports-css-rules"}]},{title:"Docker",_path:"\u002Fdocker",children:[{title:"Building Static Pages With Docker",_path:"\u002Fdocker\u002Fbuilding-static-pages-with-docker"},{title:"Drone Ci",_path:"\u002Fdocker\u002Fdrone-ci"},{title:"Github Pages With Drone Ci",_path:"\u002Fdocker\u002Fgithub-pages-with-drone-ci"},{title:"Private Docker Registry",_path:"\u002Fdocker\u002Fprivate-docker-registry"},{title:"Refresh Containers On Pull",_path:"\u002Fdocker\u002Frefresh-containers-on-pull"},{title:"Seed Dump Inside Docker",_path:"\u002Fdocker\u002Fseed-dump-inside-docker"},{title:"Wait For Mysql",_path:"\u002Fdocker\u002Fwait-for-mysql"},{title:"Wait For Redis",_path:"\u002Fdocker\u002Fwait-for-redis"}]},{title:"Frontend",_path:"\u002Ffrontend",children:[{title:"React Native",_path:"\u002Ffrontend\u002Freact-native",children:[{title:"OAuth2 Login",_path:"\u002Ffrontend\u002Freact-native\u002Foauth2-login"},{title:"Preserve FlatList Scroll Position In React Native",_path:"\u002Ffrontend\u002Freact-native\u002Fpreserve-flatlist-scroll-position-in-react-native"},{title:"Useful Comands",_path:"\u002Ffrontend\u002Freact-native\u002Fuseful-comands"}]},{title:"React",_path:"\u002Ffrontend\u002Freact",children:[{title:"Axios Refresh Token On React",_path:"\u002Ffrontend\u002Freact\u002Faxios-refresh-token-on-react"},{title:"Axios With AbortController",_path:"\u002Ffrontend\u002Freact\u002Faxios-with-abortcontroller"}]},{title:"Vue",_path:"\u002Ffrontend\u002Fvue",children:[{title:"Adding Global Properties To Component",_path:"\u002Ffrontend\u002Fvue\u002Fadding-global-properties-to-component"},{title:"Make Nuxt Handle Obsidian Highlights",_path:"\u002Ffrontend\u002Fvue\u002Fmake-nuxt-handle-obsidian-highlights"}]}]},{title:"Git",_path:"\u002Fgit",children:[{title:"Force Git To Use HTTPS",_path:"\u002Fgit\u002Fforce-git-to-use-https"},{title:"Git Aliases And Useful Commands",_path:"\u002Fgit\u002Fgit-aliases-and-useful-commands"}]},{title:"Graphql",_path:"\u002Fgraphql",children:[{title:"Apollo Client Pagination",_path:"\u002Fgraphql\u002Fapollo-client-pagination"},{title:"Refresh Token In Apollo Client",_path:"\u002Fgraphql\u002Frefresh-token-in-apollo-client"}]},{title:"Linux",_path:"\u002Flinux",children:[{title:"Gitea For Git Hosting",_path:"\u002Flinux\u002Fgitea-for-git-hosting"},{title:"Google Photos Alternative With Photoprism",_path:"\u002Flinux\u002Fgoogle-photos-alternative-with-photoprism"},{title:"Resume Or Start Screen Session",_path:"\u002Flinux\u002Fresume-or-start-screen-session"},{title:"Rsync File With SSH",_path:"\u002Flinux\u002Frsync-file-with-ssh"},{title:"Setting Up NGINX",_path:"\u002Flinux\u002Fsetting-up-nginx"},{title:"SSH",_path:"\u002Flinux\u002Fssh"}]},{title:"Sql",_path:"\u002Fsql",children:[{title:"MySQL And MariaDB Setup",_path:"\u002Fsql\u002Fmysql-and-mariadb-setup"},{title:N,_path:O}]},{title:"Typescript",_path:"\u002Ftypescript",children:[{title:"Add Global Variable To Window",_path:"\u002Ftypescript\u002Fadd-global-variable-to-window"},{title:"Flatten Object With Periods",_path:"\u002Ftypescript\u002Fflatten-object-with-periods"},{title:"Type Guards",_path:"\u002Ftypescript\u002Ftype-guards"}]}],"content-query-OeCNLqMRmJ":{_path:O,_dir:m,_draft:r,_partial:r,_locale:"en",_empty:r,title:N,description:f,excerpt:{type:P,children:[{type:a,tag:k,props:{id:s},children:[{type:b,value:t}]},{type:a,tag:d,props:{code:u,language:l},children:[{type:a,tag:i,props:{},children:[{type:a,tag:d,props:{__ignoreMap:f},children:[{type:b,value:u}]}]}]},{type:a,tag:k,props:{id:v},children:[{type:b,value:w}]},{type:a,tag:g,props:{},children:[{type:b,value:Q}]},{type:a,tag:d,props:{code:x,language:l},children:[{type:a,tag:i,props:{},children:[{type:a,tag:d,props:{__ignoreMap:f},children:[{type:b,value:x}]}]}]},{type:a,tag:k,props:{id:y},children:[{type:b,value:z}]},{type:a,tag:g,props:{},children:[{type:b,value:R},{type:a,tag:e,props:{},children:[{type:b,value:o}]},{type:b,value:S},{type:a,tag:e,props:{},children:[{type:b,value:T}]},{type:b,value:U},{type:a,tag:e,props:{},children:[{type:b,value:V}]},{type:b,value:W},{type:a,tag:e,props:{},children:[{type:b,value:o}]},{type:b,value:X},{type:a,tag:e,props:{},children:[{type:b,value:q}]},{type:b,value:p}]},{type:a,tag:Y,props:{id:A},children:[{type:b,value:B}]},{type:a,tag:g,props:{},children:[{type:b,value:Z},{type:a,tag:e,props:{},children:[{type:b,value:o}]},{type:b,value:_},{type:a,tag:e,props:{},children:[{type:b,value:q}]},{type:b,value:$},{type:a,tag:e,props:{},children:[{type:b,value:aa}]},{type:b,value:p}]},{type:a,tag:d,props:{code:C,language:ab},children:[{type:a,tag:i,props:{},children:[{type:a,tag:d,props:{__ignoreMap:f},children:[{type:b,value:C}]}]}]},{type:a,tag:g,props:{},children:[{type:b,value:ac},{type:a,tag:e,props:{},children:[{type:b,value:ad}]},{type:b,value:p}]},{type:a,tag:d,props:{code:D},children:[{type:a,tag:i,props:{},children:[{type:a,tag:d,props:{__ignoreMap:f},children:[{type:b,value:D}]}]}]},{type:a,tag:g,props:{},children:[{type:b,value:ae}]},{type:a,tag:d,props:{code:E,language:l},children:[{type:a,tag:i,props:{},children:[{type:a,tag:d,props:{__ignoreMap:f},children:[{type:b,value:E}]}]}]},{type:a,tag:g,props:{},children:[{type:b,value:af}]},{type:a,tag:d,props:{code:F,language:l},children:[{type:a,tag:i,props:{},children:[{type:a,tag:d,props:{__ignoreMap:f},children:[{type:b,value:F}]}]}]},{type:a,tag:k,props:{id:G},children:[{type:b,value:H}]},{type:a,tag:g,props:{},children:[{type:b,value:ag}]},{type:a,tag:d,props:{code:I,language:m},children:[{type:a,tag:i,props:{},children:[{type:a,tag:d,props:{__ignoreMap:f},children:[{type:b,value:I}]}]}]},{type:a,tag:k,props:{id:J},children:[{type:b,value:K}]},{type:a,tag:g,props:{},children:[{type:b,value:ah},{type:a,tag:e,props:{},children:[{type:b,value:ai}]},{type:b,value:aj}]},{type:a,tag:d,props:{code:L,language:m},children:[{type:a,tag:i,props:{},children:[{type:a,tag:d,props:{__ignoreMap:f},children:[{type:b,value:L}]}]}]},{type:a,tag:g,props:{},children:[{type:b,value:ak},{type:a,tag:e,props:{},children:[{type:b,value:al}]},{type:b,value:am}]},{type:a,tag:g,props:{},children:[{type:b,value:an}]},{type:a,tag:d,props:{code:M,language:m},children:[{type:a,tag:i,props:{},children:[{type:a,tag:d,props:{__ignoreMap:f},children:[{type:b,value:M}]}]}]}]},body:{type:P,children:[{type:a,tag:k,props:{id:s},children:[{type:b,value:t}]},{type:a,tag:d,props:{code:u,language:l},children:[{type:a,tag:i,props:{},children:[{type:a,tag:d,props:{__ignoreMap:f},children:[{type:a,tag:c,props:{class:h},children:[{type:a,tag:c,props:{class:j},children:[{type:b,value:"sudo apt update"}]}]},{type:a,tag:c,props:{class:h},children:[{type:a,tag:c,props:{class:j},children:[{type:b,value:"sudo apt install -y postgresql postgresql-contrib postgresql-client"}]}]},{type:a,tag:c,props:{class:h},children:[{type:a,tag:c,props:{class:j},children:[{type:b,value:"sudo systemctl status postgresql.service"}]}]}]}]}]},{type:a,tag:k,props:{id:v},children:[{type:b,value:w}]},{type:a,tag:g,props:{},children:[{type:b,value:Q}]},{type:a,tag:d,props:{code:x,language:l},children:[{type:a,tag:i,props:{},children:[{type:a,tag:d,props:{__ignoreMap:f},children:[{type:a,tag:c,props:{class:h},children:[{type:a,tag:c,props:{class:j},children:[{type:b,value:"sudo -u postgres psql"}]}]},{type:a,tag:c,props:{class:h},children:[]},{type:a,tag:c,props:{class:h},children:[{type:a,tag:c,props:{class:j},children:[{type:b,value:"psql (12.12 (Ubuntu 12.12-0ubuntu0.20.04.1))"}]}]},{type:a,tag:c,props:{class:h},children:[{type:a,tag:c,props:{class:j},children:[{type:b,value:"Type "}]},{type:a,tag:c,props:{class:"ct-693ddc"},children:[{type:b,value:"\"help\""}]},{type:a,tag:c,props:{class:j},children:[{type:b,value:" "}]},{type:a,tag:c,props:{class:"ct-bead46"},children:[{type:b,value:"for"}]},{type:a,tag:c,props:{class:j},children:[{type:b,value:" help."}]}]},{type:a,tag:c,props:{class:h},children:[]},{type:a,tag:c,props:{class:h},children:[{type:a,tag:c,props:{class:j},children:[{type:b,value:"postgres="}]},{type:a,tag:c,props:{class:"ct-08a6d7"},children:[{type:b,value:"#"}]}]}]}]}]},{type:a,tag:k,props:{id:y},children:[{type:b,value:z}]},{type:a,tag:g,props:{},children:[{type:b,value:R},{type:a,tag:e,props:{},children:[{type:b,value:o}]},{type:b,value:S},{type:a,tag:e,props:{},children:[{type:b,value:T}]},{type:b,value:U},{type:a,tag:e,props:{},children:[{type:b,value:V}]},{type:b,value:W},{type:a,tag:e,props:{},children:[{type:b,value:o}]},{type:b,value:X},{type:a,tag:e,props:{},children:[{type:b,value:q}]},{type:b,value:p}]},{type:a,tag:Y,props:{id:A},children:[{type:b,value:B}]},{type:a,tag:g,props:{},children:[{type:b,value:Z},{type:a,tag:e,props:{},children:[{type:b,value:o}]},{type:b,value:_},{type:a,tag:e,props:{},children:[{type:b,value:q}]},{type:b,value:$},{type:a,tag:e,props:{},children:[{type:b,value:aa}]},{type:b,value:p}]},{type:a,tag:d,props:{code:C,language:ab},children:[{type:a,tag:i,props:{},children:[{type:a,tag:d,props:{__ignoreMap:f},children:[{type:a,tag:c,props:{class:h},children:[{type:a,tag:c,props:{class:j},children:[{type:b,value:"sudo vi \u002Fetc\u002Fpostgresql\u002F12\u002Fmain\u002Fpg_hba.conf"}]}]},{type:a,tag:c,props:{class:h},children:[]},{type:a,tag:c,props:{class:h},children:[{type:a,tag:c,props:{class:j},children:[{type:b,value:ao}]}]},{type:a,tag:c,props:{class:h},children:[{type:a,tag:c,props:{class:"ct-70ca0b"},children:[{type:b,value:"local"}]},{type:a,tag:c,props:{class:j},children:[{type:b,value:" all postgres peer"}]}]},{type:a,tag:c,props:{class:h},children:[{type:a,tag:c,props:{class:j},children:[{type:b,value:ao}]}]}]}]}]},{type:a,tag:g,props:{},children:[{type:b,value:ac},{type:a,tag:e,props:{},children:[{type:b,value:ad}]},{type:b,value:p}]},{type:a,tag:d,props:{code:D},children:[{type:a,tag:i,props:{},children:[{type:a,tag:d,props:{__ignoreMap:f},children:[{type:a,tag:c,props:{class:h},children:[{type:a,tag:c,props:{},children:[{type:b,value:"local all postgres md5"}]}]}]}]}]},{type:a,tag:g,props:{},children:[{type:b,value:ae}]},{type:a,tag:d,props:{code:E,language:l},children:[{type:a,tag:i,props:{},children:[{type:a,tag:d,props:{__ignoreMap:f},children:[{type:a,tag:c,props:{class:h},children:[{type:a,tag:c,props:{class:j},children:[{type:b,value:"sudo systemctl restart postgresql"}]}]}]}]}]},{type:a,tag:g,props:{},children:[{type:b,value:af}]},{type:a,tag:d,props:{code:F,language:l},children:[{type:a,tag:i,props:{},children:[{type:a,tag:d,props:{__ignoreMap:f},children:[{type:a,tag:c,props:{class:h},children:[{type:a,tag:c,props:{class:j},children:[{type:b,value:"psql -U postgres -d postgres -h databasehostname"}]}]}]}]}]},{type:a,tag:k,props:{id:G},children:[{type:b,value:H}]},{type:a,tag:g,props:{},children:[{type:b,value:ag}]},{type:a,tag:d,props:{code:I,language:m},children:[{type:a,tag:i,props:{},children:[{type:a,tag:d,props:{__ignoreMap:f},children:[{type:a,tag:c,props:{class:h},children:[{type:a,tag:c,props:{},children:[{type:b,value:"create user myuser with encrypted password 'Supersecret';\nCREATE ROLE\n\npostgres=# \\du\n List of roles\n Role name | Attributes | Member of\n-----------+------------------------------------------------------------+-----------\n myuser | | {}\n postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}"}]}]}]}]}]},{type:a,tag:k,props:{id:J},children:[{type:b,value:K}]},{type:a,tag:g,props:{},children:[{type:b,value:ah},{type:a,tag:e,props:{},children:[{type:b,value:ai}]},{type:b,value:aj}]},{type:a,tag:d,props:{code:L,language:m},children:[{type:a,tag:i,props:{},children:[{type:a,tag:d,props:{__ignoreMap:f},children:[{type:a,tag:c,props:{class:h},children:[{type:a,tag:c,props:{},children:[{type:b,value:"CREATE DATABASE dbname OWNER myuser;\nCREATE DATABASE\n\npostgres=# \\l\n List of databases\n Name | Owner | Encoding | Collate | Ctype | Access privileges\n-----------+----------+----------+-------------+-------------+-----------------------\n dbname | myuser | UTF8 | en_US.UTF-8 | en_US.UTF-8 |\n postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |\n template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c\u002Fpostgres +\n | | | | | postgres=CTc\u002Fpostgres\n template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c\u002Fpostgres +\n | | | | | postgres=CTc\u002Fpostgres"}]}]}]}]}]},{type:a,tag:g,props:{},children:[{type:b,value:ak},{type:a,tag:e,props:{},children:[{type:b,value:al}]},{type:b,value:am}]},{type:a,tag:g,props:{},children:[{type:b,value:an}]},{type:a,tag:d,props:{code:M,language:m},children:[{type:a,tag:i,props:{},children:[{type:a,tag:d,props:{__ignoreMap:f},children:[{type:a,tag:c,props:{class:h},children:[{type:a,tag:c,props:{},children:[{type:b,value:"postgres=# alter database dbname owner to myuser;\nALTER DATABASE"}]}]}]}]}]},{type:a,tag:"style",children:[{type:b,value:".ct-70ca0b{color:#FF7B72}.ct-08a6d7{color:#8B949E}.ct-bead46{color:#FF7B72}.ct-693ddc{color:#A5D6FF}.ct-ab6896{color:#C9D1D9}.light .ct-ab6896{color:#657B83}.light .ct-693ddc{color:#2AA198}.light .ct-bead46{color:#859900}.light .ct-08a6d7{color:#93A1A1}.light .ct-70ca0b{color:#073642}"}]}],toc:{title:f,searchDepth:n,depth:n,links:[{id:s,depth:n,text:t},{id:v,depth:n,text:w},{id:y,depth:n,text:z,children:[{id:A,depth:3,text:B}]},{id:G,depth:n,text:H},{id:J,depth:n,text:K}]}},_type:"markdown",_id:"content:SQL:Postgress setup.md",_source:"content",_file:"SQL\u002FPostgress setup.md",_extension:"md"}},prerenderedAt:1667453434809}}("element","text","span","code","code-inline","","p","line","pre","ct-ab6896","h2","bash","sql",2,"postgres",".","pg_hba.conf",false,"install-postgresql-12-on-ubuntu-2004-lts","Install PostgreSQL 12 on Ubuntu 20.04 LTS","sudo apt update\nsudo apt install -y postgresql postgresql-contrib postgresql-client\nsudo systemctl status postgresql.service\n","initial-database-connection","Initial database connection","sudo -u postgres psql\n\npsql (12.12 (Ubuntu 12.12-0ubuntu0.20.04.1))\nType \"help\" for help.\n\npostgres=#\n","set-password-for-postgres-database-user","Set password for postgres database user","update-pg_hbaconf-to-allow-postgres-user-connections-with-password","Update pg_hba.conf to allow postgres user connections with password","sudo vi \u002Fetc\u002Fpostgresql\u002F12\u002Fmain\u002Fpg_hba.conf\n\n...\nlocal all postgres peer\n...\n","local all postgres md5\n","sudo systemctl restart postgresql\n","psql -U postgres -d postgres -h databasehostname\n","creation-of-additional-database-users","Creation of additional database users","create user myuser with encrypted password 'Supersecret';\nCREATE ROLE\n\npostgres=# \\du\n List of roles\n Role name | Attributes | Member of\n-----------+------------------------------------------------------------+-----------\n myuser | | {}\n postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}\n","creation-of-additional-databases","Creation of additional databases","CREATE DATABASE dbname OWNER myuser;\nCREATE DATABASE\n\npostgres=# \\l\n List of databases\n Name | Owner | Encoding | Collate | Ctype | Access privileges\n-----------+----------+----------+-------------+-------------+-----------------------\n dbname | myuser | UTF8 | en_US.UTF-8 | en_US.UTF-8 |\n postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |\n template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c\u002Fpostgres +\n | | | | | postgres=CTc\u002Fpostgres\n template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c\u002Fpostgres +\n | | | | | postgres=CTc\u002Fpostgres\n","postgres=# alter database dbname owner to myuser;\nALTER DATABASE\n","Postgress Setup","\u002Fsql\u002Fpostgress-setup","root","A local connection (from the database server) can be done by the following command:","The password for the "," database user can be set the the quick command ","\\password","\nor by ","alter user postgres password 'Supersecret'",". A connection using the "," user\nis still not possible from the \"outside\" hence to the default settings in the ","h3","In order to allow connections of the "," database user not using OS user\nauthentication, you have to update the "," which can be found under\n","\u002Fetc\u002Fpostgresql\u002F12\u002Fmain\u002Fpg_hba.conf","shell","Change the last section of the above line to ","md5","A restart is required in order to apply the new configuration:","Now a connection from outside the database host is possible e.g.","A database user can be created by the following command:","One can create new Postgres databases within an instance. Therefore you can use the ","psql","\ncommand to login (see above).","You can leave the ","OWNER"," section of the command, when doing so, the current user will become\nowner of the newly created database.","To change the owner of an existing database later, you can use the following command:","..."))