Postgresql
psql -h 192.168.1.100 -p 5432 -U u1 mydatabase import psycopg2 conn = psycopg2.connect("host='10.59.1.50' dbname='DB' user='perm' password='perm'")
Interesting sites
PostgreSQL
- https://postgresqlco.nf/ - configuration
- https://pgpedia.info/ - encyclopedia of postgres
- https://www.interdb.jp/pg/ - internal structure postgresql Pavel Kopalov, [13.04.21 22:23]
- https://pgstats.dev/ PostgreSQL Observability
- https://habr.com/ru/companies/tensor/articles/771406/ - Antipatterns
- https://pgconfig.rustprooflabs.com/ - compare config with default
- https://postgresqlco.nf/tuning-guide - configure
- https://til.hashrocket.com/posts/da9ade5291-clear-the-screen-in-psql - psql clear console
Draw Db diagram
- <https://dbdiagram.io/home> нарисовать диаграмму данных
Kubernetes - postgres VIEW
Postgres.Cmd
Postgres.System commands
Star stop init db create databases
pg_config –configure
- как скомпилирован Postgres
Postgres.PSQL
Postgres.Sql
- https://habr.com/ru/articles/791260/ - courses
- https://gist.github.com/rgreenjr/3637525 - useful sqls
- https://habr.com/ru/post/280912/ Pg Трюки
- progress bar query observable https://postgres.ai/blog/20220114-progress-bar-for-postgres-queries-lets-dive-deeper
Sql.system
Sql.check
Sql.Generate Data
Sql.JSONB
- PG JSON fucntion - https://postgrespro.ru/docs/postgresql/14/functions-json
- Antipattern jsonb - https://github.com/jugatsu/onec-docker#support
Postgres.DATA
Postgres.DBA
Describe of admin tasks
- Check configuration files -
select sourcefile, name,sourceline,error from pg_file_settings where error is not null;
- Check config of authorization in postgresqland pg_hba
SHOW password_encryption;SELECT * FROM pg_hba_file_rules();
Bloat - MVCC - transaction - Get current xmin - PageInspector
Situation with Invalid page header encountered: blockNo 0, path .... base/16384/923678
- shared memory no space left https://medium.com/@tough_jonquil_dog_815/postgresql-no-space-left-on-device-a9c5c3b41cff
- docker shared memory https://www.instaclustr.com/blog/postgresql-docker-and-shared-memory/
Postgres.DBA locale collation LC_COLLATE setlocale
- debian
localedef -i ru_RU -c -f UTF-8 -A /usr/share/locale/locale.alias ru_RU.utf8 export LANG=ru_RU.utf8
Postgres.DBA users privileges grant
Postgres.DBA dependencies
dependencies - pg_depend get info
dependencies - pg_depend Hierarchies
dependencies - pg_depend Recursive Hierarchies - объекты ссылающиеся на объект исследования
Postgres.DBA extensions / function
Postgres.DBA partition
Postgres.Backup
Резервное копирование pg_dump и pg_restore
Postgres.Backup.Wal-g wal-g
- Wal-g - https://habr.com/ru/post/506610/ - пример
- пример ручного dump c WAL https://pgdash.io/blog/postgres-incremental-backup-recovery.html
Wal-g.Backup статьи
- надежные и быстрые бэкапы ссылка
Wal-g.Backup резервного копирования
WAL-G.restore восстановление
PostgresPro
- https://github.com/sgrinko/docker-postgres - docker good example
Postgres Cluster
Postgres Information , monitoring , performance , tools
- разбор запросов explain tensorанализатор запросов postgresql pev2
psql -XqAt -f /opt/dmp/walg/explain.sql UIS_MV > /tmp/analyze.json
Postgres.Monitoring
- pgwatch2 - monitoring Postgres
Postgres.performance
Usefull tools
Postgresql Partition
Postgres.Книги
- https://postgrespro.ru/education/books/internals - PostgreSQL 14 изнутри
- https://www.interdb.jp/pg/index.html - The Internals of PostgreSQL
Postgres Install
- postgres install example in docker https://habr.com/ru/post/578744/
- https://habr.com/ru/articles/735274/comments/ - postgresql docker shared_buffers effective_cache_size work_mem shm_size Random_page_cost ssd