From the course: PostgreSQL: Client Applications
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Create a database - PostgreSQL Tutorial
From the course: PostgreSQL: Client Applications
Create a database
- [Lecturer] New databases can be quickly set up using the createdb client application. It uses the same connection parameters as psql in order to connect to the server. So once you've learned them there, you'll be able to apply that knowledge to this tool as well. It all starts with the createdb command. After that, we need to specify where we want to create the new database. So we'll go back to those connection parameters. - h will specify the IP address or the machine name that we want to connect to of the server. So you could say -h localhost. You'll use -p to set the port 5432, and -U to specify the user account that has the authorization to create the new database. I'll use the postgres super-user account. Now we don't need to connect to a specific database in order to create a new database. So there's no need to specify the -D parameter. This will create the new database on the server and assign ownership to the postgres user account. If you wanted to assign a different user as…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Connect to a PostgreSQL server7m 11s
-
(Locked)
Create a database3m 20s
-
Execute SQL commands7m 1s
-
(Locked)
Backslash (meta) commands4m 6s
-
(Locked)
Get help with SQL command keywords5m 36s
-
(Locked)
Execute commands from a file2m 43s
-
(Locked)
List database contents7m 39s
-
(Locked)
Describe object configuration2m 29s
-
(Locked)
Challenge: Obtain database information1m 14s
-
(Locked)
Solution: Obtain database information4m 52s
-
-
-
-
-