The blog has moved to ... Many google searches point here so I am leaving it operational, but there will be no new posts.

Sunday, April 29, 2012

postgres: random useful things

Run sql statements from the command line, use the -c flag

create a random value

crazy updates using regexp_matches

postgres: terminate all database connections

Using psql from the command line you can terminate all connections to a database

Comes in handy when you want to do things like restore your staging or development database