There will be no singularity – Telegram
There will be no singularity
1.99K subscribers
248 photos
15 videos
5 files
995 links
Smartface, technologies and decay
@antonrevyako
Download Telegram
Я как-то рассказывал об одной неочевидной причине, по которой апгрейд версии посгреса может привести к болям в разных частях тела - после 12 версии изменился формат сообщений об ошибках (https://news.1rj.ru/str/nosingularity/875).

Но сегодня всплыл еще один сюрприз:
тип результата функции EXTRACT в 14 версии изменился с double precision на numeric.

И казалось бы, в чем проблема?
Но дальше все зависит от вашего языка и драйвера.
Pg-promise по умолчанию кастит numeric к строке, и в результате вместо ожидаемого инта вы получаете строку, в которой будет число с 16 нулями после запятой.

Дальше, я думаю, понятно...

И я подумал - почему бы не взять все доступные функции и сравнить их сигнатуры от версии к версии. Благо в посгре это можно сделать одним селектом из таблицы pg-proc.
Сказано - сделано!
https://github.com/antonrevyako/postgresql-functions-changes

Справедливости ради, особых откровений в этом сравнении нет:
- в pg12 выкинули типы abstime and reltime, и соответственно все функции с ними.
- в pg12 добавили параметр к функциям конвертации character encoding.
- в pg14 уточнили типа anyarray и any до anycompatiblearray и anycompatible соответственно.
- ну и всякое по мелочи...

Но EXTRACT в этот список не попал :)
В pg-proc не входят функции со специальным синтаксисом, они захардкожены.

Мне когда-нибудь будет не лень и я сравню и все специальные функции тоже...

Еще в процессе тестирования выяснилось, что pg10 ругается, когда пытаешься скастить json-ноду к простому типу, например BOOLEAN, а все версии выше не ругаются.
Энивей, так делать не надо ни в какой версии, поэтому про это будет соответсвующее правило в holistic.dev :)
Miss me?

It seemed to me that since we did not have the news that you all are waiting for, then I should just be silent.

But some of you are missing my old man jokes, and I decided to break the silence.

I'm still here.
I'm feeling good and located in a safe place if you're asking :)

We almost shipped the first version of column-to-column lineage in dwh.dev and browser plugin for fast cloud providers integration in holistic.dev

So, everything is going on, some great news is coming :)

As you can notice, I decided to try to switch to English. For sure, my graphomaniac texts will lose spectacular humor and charm, but I think that this is the least of what is not a pity to lose in the current situation.
There is a new item (from the subscriber) in my collection of non-DB SQL tools at github:

https://github.com/noborus/trdsql
CLI tool that can execute SQL queries on CSV, LTSV, JSON and TBLN. Can output to various formats.
Two weird PostgreSQL-related projects in a row:

postgresml.org - OSS extension for training and deploying ML models from inside Postgres

hydras.io - SaaS Postgres to Snowflake mapping
Reason #12345 for using postgresql instead of mysql (https://twitter.com/tobias_petry/status/1526868551994318850)
Developers: ORM allows us to change the database vendor if necessary.
ORM: https://docs.djangoproject.com/en/4.0/ref/contrib/postgres/fields/
Two different people have brought my attention to Neon Database (Nikita Shamgunov's startup, co-founder of MemSQL / SingleStore) – a serverless implementation of PostgreSQL, an auto-scaling, on-demand database as a service for modern applications.

Neon's key innovation is the separation of storage and compute (just like in snowflake :) ), which simplifies provisioning and managing database capacity, and enables key features like horizontal scaling and branching that are otherwise hard to achieve.
Demo 🐘

Now they are looking for Engineering manager ($150-300k+/year, remote-first or relocation to Cyprus), golang dev and rust dev

Feel free to contact @owlkov for details