ads' corner

Advent of Code 2020: "Password Philosophy" - Day 2

Day 2, another challenge: fix a broken password database. In order to do that, the passwords which violate the policy must be identified.


Advent of Code 2020: "Report Repair" - Day 1

Started “Advent of Code” with the kid, the kid is polishing the Python (and English) skills. I thought I better do this in SQL.


SELECT pg_sleep_until('#800Monies');

Pavlo recently pointed out that the pg_sleep() function in PostgreSQL has two alternatives: pg_sleep_for() and pg_sleep_until().

What do they do?


role ... cannot be dropped because some objects depend on it

I want to drop a ROLE (previously USER/GROUPs) which is still referenced by object(s) in my database. But PostgreSQL has objections:


create language if not exist

In a customer project I have to setup a database from a Makefile. Part of my problem: on Windows the installer may or may not install plpgsql into template1, therefore in consequence this language may or may not be activated in every new database. But that’s not predictable. This problem can appear on different Linux/Unix distributions too.


Understanding SQL

Have to port a phpkit database to something else. It seems, the phpkit ppl did not really understand what SQL is for.


table size, database size

I have seen this question more than once in the past: “How much storage space do I need for my table?”

PostgreSQL can give you this information.