Author | Message |
---|---|
victormejia
Posts: 40
|
Posted 09:50 Oct 05, 2010 |
I had a couple of questions regarding PostgreSQL. I noticed that I can still log in to the database server using psql -U postgres even though I haven't started the server using pgAdmin. Why is that so? Also, for setting up the csns database, do we create both a csns user and a csns database? Right now I just created a user "cs520" and once I logged in under cs520 I created the csns database. Do I need to have a "cs520" database? Also I am unsure how to use and populate a PostgreSQL database. In MySQL it was just use database_name; and source file.sql but this doesn't work |
kknaur
Posts: 540
|
Posted 14:43 Oct 05, 2010 |
Hey Victor,
Running a Script File: psql -f script.sql databaseName I got it from this website which has some other useful information on it as well: http://www.petefreitag.com/cheatsheets/postgresql/
For the User Name:
Database Name:
|
cysun
Posts: 2935
|
Posted 23:13 Oct 05, 2010 |
1. Both psql and pgAdmin are database clients. The database server is already running no matter which one you use. 2. You don't need a create a csns user. 3. You don't need to create a cs520 database. 4. In psql it's "\c database_name" (like "use database_name" in MySQL) and "\i file.sql" (like "source file.sql"). Read documentation. Last edited by cysun at
23:14 Oct 05, 2010.
|
victormejia
Posts: 40
|
Posted 12:08 Oct 06, 2010 |
Thanks for the help! |