Better HN
topnewbestaskshowjobs
Log inSign up

tbicr

61 karma · joined Oct 23, 2018 (8y ago) · 6 submissions

Submissions

1.

Wisdom of the crowd Python web frameworks rank(github.com ↗)

4 points · by tbicr · 5y ago · discuss

2.

New Postgres 12 SET NOT NULL constraint creation with minimal lock

1 points · by tbicr · 7y ago · discuss

comment 8y ago · link · parent

Unfortunately savepoints live only in transaction and ACCESS EXCLUSIVE will be released only on whole transaction commit/rollback, so look like no benefits with savepoints for schema migrations to compare with plain transaction.

comment 8y ago · link · parent

Constraints creation also tricky because in transaction it take ACCESS EXCLUSIVE lock (eg. lock table on READ/WRITE) and spend time to constraint validation (CHECK, NOT NULL, FOREIGN KEY), so lock will be released only on transaction commit/rollback.

comment 8y ago · link · parent

I found only two caveats:

- it doesn't use transactions, so if migration will down, then you will need to fix state manually (one point of improvement), however you cannot run `CREATE INDEX CONCURRENTLY` in transaction.

- it can use `CHECK (column IS NOT NULL)` constraint for safe `NOT NULL` replacement for huge tables, that isn't compatible with standard django behavior.

So all this cases highlighted in README.

6.

Django zero-downtime migrations for Postgres that respect database locks(github.com ↗)

122 points · by tbicr · 8y ago · 34 comments