Skip to content

Instantly share code, notes, and snippets.

@nabucosound
Last active December 11, 2015 10:28
Show Gist options
  • Save nabucosound/4586449 to your computer and use it in GitHub Desktop.
Save nabucosound/4586449 to your computer and use it in GitHub Desktop.

PostgreSQL 9.1 Cheatsheet

sudo su postgres

Create cluster:

pg_createcluster 9.1 main --start

Create database:

createdb mydatabase

Restore gzipped pgdump:

gunzip -c mydatabase.pgdump.gz | psql mydatabase

Restart cluster:

pg_ctlcluster 9.1 main restart

Change postgres password:

psql mydatabase
ALTER USER Postgres WITH PASSWORD '<newpassword>';

Add unaccent contrib for searches without accents or other non-ascii:

psql canubring
CREATE EXTENSION "unaccent";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment