0

Hello Im trying to load the sample database like in this tutorial:

http://www.postgresqltutorial.com/load-postgresql-sample-database/

It says "First, launch the psql tool.", does it mean the pgadmin programm, or the sql shell(psql)?

Where can I succesfully put in the following commands in pgadmin? I dont believe it belongs to the SQL query field, plz help me.

2
  • Launch whatever works for you. Pgadmin tool should be easier to work with if you're new to PG-SQL. Commented Aug 11, 2013 at 9:35
  • @CraigRinger make this an answer, I've deleted mine :) Commented Aug 11, 2013 at 10:13

1 Answer 1

1

The does indeed mean the command-line tool psql, but you could just as easily create the database from within PgAdmin-III's GUI. Just right click on "Databases" and then "New Database". Or use PgAdmin-III's SQL executor window to run the CREATE DATABASE command.

Personally I recommend getting familiar with psql. Some things, like \ commands, will only work in psql. People keep on trying to run \copy, \d, etc in PgAdmin-III and getting confused when it doesn't work. psql is also - in my opinion - a lot more productive once you're used to working with it. Even if you regularly use PgAdmin-III you'll want to know how to use psql for some things like loading an SQL-format dump, so you might as well get onto it sooner rather than later.

(BTW, that site is ... weird. I've never seen it before, it has masked data in whois, there's no contact info or information about who wrote it, no apparent commercial links. Interesting.)

Consider reading the official postgresql tutorial; it tries to explain more, rather than just giving step-by-step instructions. It also requires a bit more understanding though, as it's written more for Linux/unix users and contains install instructions that won't apply to you on Windows.

Sign up to request clarification or add additional context in comments.

3 Comments

thank you for the fast answers..., but I still have problems executing the given commands from postgresqltutorial.com/load-postgresql-sample-database . Am I puttin in a wrong username? Take a look at this screenshot: imagebanana.com/view/fmij9dw3/noresult.png
@user2671998 Um... So many things wrong with that. pg_restore is a separate command run in the shell, not a psql command. You didn't finish logging in to the database, you just started typing the shell command before finishing all the prompts, so it would never work anyway. Perhaps you're better off starting here?: postgresql.org/docs/current/static/tutorial.html
@user2671998 The immediate problem is that when psql asks you "what server do you want to connect to" with the Server: prompt, you put in CREATE DATABASE .... Understandably that doesn't work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.