Skip to content

Instantly share code, notes, and snippets.

View gavinmh's full-sized avatar

Gavin Hackeling gavinmh

View GitHub Profile
@gavinmh
gavinmh / psql.md
Created September 5, 2017 02:47 — forked from cimmanon/psql.md
PostgreSQL cheat sheet for MySQL users

I use PostgreSQL via the psql client. If you use a different client (eg. pgAdmin, etc.), I don't know how much will translate over.

One nice difference between psql and mysql (cli) is that if you press CTRL+C, it won't exit the client.

User administration

Login as superuser (via shell)

psql -U postgres
{
"IAB1": "Arts & Entertainment",
"IAB1-1": "Arts & Entertainment::Books & Literature",
"IAB1-2": "Arts & Entertainment::Celebrity Fan/Gossip",
"IAB1-4": "Arts & Entertainment::Humor",
"IAB1-5": "Arts & Entertainment::Movies",
"IAB1-6": "Arts & Entertainment::Music",
"IAB1-7": "Arts & Entertainment::Television",
"IAB1-3": "Arts & Entertainment::Fine Art",
"IAB2": "Automotive",