Site down right now? Call or text, and I'll start the same day. (910) 338-4964
Randy Johnson
← All posts

PostgreSQL on the command line

I am just getting back into PostgreSQL. Here are the things I had to learn today: 1. Command line usage: su - postgres psql select version(); 2. Dumping data for import on another server pg_dump -o mydb -U postgres -W > mydb.sql -o has t...

I am just getting back into PostgreSQL.  Here are the things I had to learn today:

1.  Command line usage:

  • su - postgres
  • psql
  • select version();

2.  Dumping data for import on another server

  • pg_dump -o mydb -U postgres -W > mydb.sql

  • -o has to do with oids (Not sure if I need this yet)

  • -U is for user

  • -W is for password.  It prompts when you run the command

More posts