Haki(@be_haki) 's Twitter Profileg
Haki

@be_haki

A software developer and a technical lead. I take a special interest in databases, web development, software design and performance tuning.

ID:2834924845

linkhttps://hakibenita.com calendar_today28-09-2014 09:32:44

1,4K Tweets

2,9K Followers

142 Following

Haki(@be_haki) 's Twitter Profile Photo

If you happened to miss this tweet than it turns out you *can* use hash indexes in PostgreSQL to enforce uniqueness using an exclusion constraint!

This is not very intuitive and not explicitly documented (that I know of) which makes you think if there are any caveats to it...

If you happened to miss this tweet than it turns out you *can* use hash indexes in PostgreSQL to enforce uniqueness using an exclusion constraint! This is not very intuitive and not explicitly documented (that I know of) which makes you think if there are any caveats to it...
account_circle
Andrew Atkinson(@andatki) 's Twitter Profile Photo

Had a great time meeting Charles (Charles Max Wood | [email protected]), Valentino (@thecodenamev), and Dave (@kobaltz) at Ruby Rogues! We discussed PostgreSQL with Ruby on Rails. We chatted about the writing process, and how it's aimed at 'Application DBAs' (credit: Haki). ๐Ÿ‘‰
twitter.com/rubyrogues/staโ€ฆ

account_circle
Haki(@be_haki) 's Twitter Profile Photo

interval expressions in PostgreSQL can accept both positive and negative values in a single expression.

For example, given the first day of the month - calculate the last day of the month:

SELECT '2024-01-01'::date + INTERVAL '1 month - 1 day';

๐Ÿ‘ŒNice

#TIL interval expressions in PostgreSQL can accept both positive and negative values in a single expression. For example, given the first day of the month - calculate the last day of the month: SELECT '2024-01-01'::date + INTERVAL '1 month - 1 day'; ๐Ÿ‘ŒNice
account_circle
pganalyze(@pganalyze) 's Twitter Profile Photo

Did you know there is a surprising performance drop in performance when using medium size values and TOAST? In today's episode we look at why this drop is happening and describe two ways to mitigate it. We feature Haki: hubs.li/Q027wxNM0

account_circle
Haki(@be_haki) 's Twitter Profile Photo

How do you implement 'get or create' in ?

My best effort (that don't cause unnecessary bloat) includes 3 CTEs and ~25 lines... ON CONFLICT and MERGE are useless.

Any better ideas?

How do you implement 'get or create' in #PostgreSQL? My best effort (that don't cause unnecessary bloat) includes 3 CTEs and ~25 lines... ON CONFLICT and MERGE are useless. Any better ideas?
account_circle
Gunnar Morling ๐ŸŒ(@gunnarmorling) 's Twitter Profile Photo

'Lesser Known PostgreSQL Features' (2021)

Nice one, by Haki. TIL about tablefunc() and \crosstabview for creating pivot tables in /psql ๐Ÿค“.

What's your favourite PG secret feature more folks should know about?

hakibenita.com/postgresql-unkโ€ฆ

'Lesser Known PostgreSQL Features' (2021) Nice one, by @be_haki. TIL about tablefunc() and \crosstabview for creating pivot tables in #Postgres/psql ๐Ÿค“. What's your favourite PG secret feature more folks should know about? hakibenita.com/postgresql-unkโ€ฆ
account_circle
Haki(@be_haki) 's Twitter Profile Photo

Is anybody using PREPARE TRANSACTION in PostgreSQL to conduct a distributed transaction over multiple different data stores? Curious about *actual* use cases. (For example, enqueue to some external queue inside a transaction...)

account_circle
Haki(@be_haki) 's Twitter Profile Photo

I'm giving a talk this Thursday on PyCon Sri Lanka about concurrency in web application

I'm going to show how to keep your data consistent and your system running smoothly w/o compromising (too much) performance๐Ÿš€

It's free, online and interactive!

๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡
pycon.lk

account_circle
Haki(@be_haki) 's Twitter Profile Photo

Excellent article highlighting some techniques for utilizing typing in Python to write safer code ๐Ÿ‘Œ

Also TIL about NewType (I've used TypeAlias so far but NewType is better).

If you write Python read it now, seriously ๐Ÿ‘‡

account_circle