Я как-то рассказывал об одной неочевидной причине, по которой апгрейд версии посгреса может привести к болям в разных частях тела - после 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 :)
Но сегодня всплыл еще один сюрприз:
тип результата функции 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 :)
Telegram
Сингулярности не будет (18+)
На днях вышел Postgresql 14 (подробности о новинках тут).
Но я пока продолжу сидеть на 12 версии...
Во-первых, потому что у меня managed база в облаке, а там все происходит небыстро (хотя в azure, говорят, уже есть)
А во-вторых, есть еще одна проблема…
Но я пока продолжу сидеть на 12 версии...
Во-первых, потому что у меня managed база в облаке, а там все происходит небыстро (хотя в azure, говорят, уже есть)
А во-вторых, есть еще одна проблема…
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.
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.
Clickhouse is faster than PostgreSQL or BigQuery for Geospatial Enrichment
https://tech.marksblogg.com/faster-geospatial-enrichment.html
https://tech.marksblogg.com/faster-geospatial-enrichment.html
Marksblogg
Faster Geospatial Enrichment
Benchmarks & Tips for Big Data, Hadoop, AWS, Google Cloud, PostgreSQL, Spark, Python & More...
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.
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
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)
Absolutely fucking insane!
Using snowflake data market for ingesting your stripe data into your snowflake db:
https://stripe.com/en-gb/data-pipeline
Using snowflake data market for ingesting your stripe data into your snowflake db:
https://stripe.com/en-gb/data-pipeline
Stripe
Stripe Data Pipeline: Sync Stripe data to your data warehouse
Stripe Data Pipeline sends all your up-to-date Stripe data to Snowflake or Amazon Redshift in a few clicks.
Developers: ORM allows us to change the database vendor if necessary.
ORM: https://docs.djangoproject.com/en/4.0/ref/contrib/postgres/fields/
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
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
MASKING POLICY in PostgreSql:
https://www.postgresql.org/about/news/postgresql-anonymizer-10-privacy-by-design-for-postgres-2452/
https://www.postgresql.org/about/news/postgresql-anonymizer-10-privacy-by-design-for-postgres-2452/
PostgreSQL News
PostgreSQL Anonymizer 1.0: Privacy By Design For Postgres
Limoges, France, May 17th, 2022 `PostgreSQL Anonymizer` is an extension that hides or replaces personally identifiable information (PII) or commercially …