Tag Archives: PostgreSQL

Install postgresql 11 on CentOs7

Just what to do, no discussion.

Postgres in docker: random «unique violation» errors

While running postgres in docker (for development, of course), from time to time I just run into errors like «Duplicate Key Value Violates Unique Constraint». I found the solution (thanks to this answer, for sure — https://stackoverflow.com/a/47089825/801426): if you have a table called «[table]», just do this

Another cool article on using PostgreSQL+pgBouncer with go

Extremely interesting and very practical talk about problems occurring with go+pgBouncer (in Russian, sorry). https://habr.com/ru/company/oleg-bunin/blog/461935/ And a video on that: https://www.youtube.com/watch?v=Uojy57I-xP0

PgBouncer and prepared statements

In our system, we use connection pooler called PgBouncer as a proxy to PostgreSQL server. PgBouncer has two main modes Session pooling mode This mode is less performant (it’s a default mode). When a client connects, a server connection will be assigned to it for the whole duration it stays connected. So it does not …

Read more

PostgreSQL: TOP slow queries

Golang, PostgreSQL and array_agg

If you have SQL like this:

PostgreSQL: using indices on json fields

It’s obviously a really bad idea. But if you really need it, that’s what you can do.

Postgresql: show all locked queries

SQL: выборка разреженных данных (не больше раза в час)

Допустим, мы сохраняем данные в базу раз в 10 минут. Нужно достать данные из базы, начинающиеся с определённого времени и не чаще одного раза за час. В качестве базы используется sqlite3, но идея реализуется так же для других SQL.

Подробное объяснение EXPLAIN в PostgreSQL