1980s — Drawing on the flip side of Cobol listings my dad printed out at work. Sadly did not learn the language.
1990s — A friend wrote a game in Pascal (I think). I opened the compiled binary in DOS and wondered how anyone could understand it.
One useful feature of Postgres is advisory locking, which allows creating database locks using arbitrary keys which have special meaning for your application, but are not necessarily related to any database entity.