Placeholder Image

Subtitles section Play video

  • Hello viewer.

  • I am SO glad you could join me today, because I am going to introduce you to your new friend:

  • PostgreSQL.

  • This open source database is taking the world by storm, both on the ground and up there

  • in the cloud.

  • It gives you an advanced relational database for the low, low price of free.

  • And if you convert free into your local currency, it is still free.

  • You cannot beat that with a stick, am I right?

  • I am right.

  • Let’s take a moment and stare at the name.

  • This is pronouncedPost gres SQL”, but most people simply sayPost gresfor

  • short.

  • Because let’s be honest - who has time for syllables?

  • We have things to do and data to store.

  • To begin, let’s take a moment and stare at the name some more...

  • The prefixposthints that something came beforegres”.

  • And this is true.

  • To understand the name, we have to go far back in time to the 1970s.

  • The place?

  • Berkeley, California.

  • The time?

  • The 1970s.

  • There is a lot of unfortunate fashion ... and a world class university.

  • Scientists are hard at work on a research project calledIngres.”

  • There was much rejoicing...

  • But it’s not perfect, so in the 1980s a follow-up project was started to fix some

  • problems with Ingres.

  • Because it came afteringres,” this project was calledPOSTgres.”

  • Very clever, you computer scientists.

  • And then in the 1990s, even MORE improvements were made.

  • Instead of using thePOSTQUEL query language,” the database was updated to support SQL which

  • was taking the world by storm.

  • PostgreSQL was born and there was even more rejoicingand downloading...

  • To install Postgres, visit its official websitepostgresql.org

  • If you visit this page and things look different than they do here, do not panic.

  • Websites change, and you should not fear change

  • unless the change is scary, then you should be terrified.

  • Click download

  • And select a version for the operating system you are using.

  • We will demonstrate the installation procedure using the EnterpriseDB installer.

  • I do not know about you, but I like to live on the edge, so I will be choosing the most

  • recent version of Postgres.

  • If you see a more recent version than the one listed here, congratulations future viewer.

  • To build suspense before installing Postgres, let’s take a trip back in time to when we

  • first visited the Postgres home page.

  • That was a crazy time...

  • Notice that there are elephants everywhere.

  • Why is this?

  • For starters, elephants are beautiful and amazing animals.

  • Big, majestic...

  • But the main reason is thatelephants never forget.”

  • And you do not want your database to forget

  • A nice choice for a mascot.

  • Well done, Postgres.

  • We are now ready to install Postgres, so run the installer

  • We will install the pgAdmin component separately, so uncheck that box.

  • You will definitely want to install the command line tools, because engineers get double respect

  • points when typing in commands versus using a GUI.

  • But do not worry.

  • We will install the pgAdmin GUI shortly so you can use that when no one is looking.

  • I am going to store the Postgres data on a separate hard drive than the OS drive.

  • If you only have a single hard drive, do not panic.

  • No harm will befall you.

  • And now you must make an important decision: select a superuser password.

  • It better not bepassword.”

  • If you are going to be a super user, you need to pick a super password.

  • Next, you can select the port for your server.

  • Postgres defaults to 5-4-3-2 which is what we will use.

  • Oh good, more questions

  • Default locale

  • Next...

  • The end is in sight.

  • Verify everything is correct and clicknextagain.

  • You have got to be kidding me

  • Next

  • This is what I like to see.

  • Status bars, rapidly changing text, and the promise of a new database in a few seconds

  • Or maybe a few minutes.

  • I will exercise my right to be impatient and deselect the Stack Builder option so we can

  • start to build our database.

  • But first, we will install a Postgres GUI tool.

  • The one we will install is calledpgAdmin.”

  • You may wonder what thepgstands for.

  • Pretty Good

  • I think

  • To download the tool, go topgAdmin.org”.

  • I see an elephant, so we must be at the right place.

  • From here we know the drill.

  • Click download

  • Select your operating system.

  • Be bold and use the most recent version

  • As is typically the case when installing new software, clickNextuntil you get to

  • a license agreement with a lot of text in all caps.

  • I always include a similar warning on my CV.

  • And install.

  • Now that we have installed both the Postgres database and the pgAdmin tool, let us see

  • the fruits of our labor.

  • Start the pgAdmin tool.

  • Congratulations.

  • We have made it to the starting line.

  • We now begin our tour of the pgAdmin interface.

  • The pgAdmin interface should feel inviting.

  • The Postgres elephant even saysWelcometo us in a cordial font.

  • At the top you have a menubar.

  • Underneath you have several tabs, with the Dashboard already selected.

  • There are links to help you get started.

  • Create a new server

  • Configure the pgAdmin GUI...

  • And resources for getting help.

  • My favorite is the PostgreSQL user’s manual.

  • At over 3,500 pages long, it is a fascinating manual.

  • There is even an audiobook version available that is only 400 hours long.

  • I saved the best for last.

  • The sidebar.

  • At the top, we have a “server groupcalledservers.”

  • As the name suggests, a “server groupis a container for organizing your servers.

  • The “1” after the nameServerslets you know there is currently one server in

  • this group.

  • The default server is calledPostgreSQL 11” and is granted Elephant Icon Status.

  • If you expand this server you will see additional categories:

  • Databases Login and Group Roles

  • And Tablespaces We have come this far to see a Postgres database,

  • so let’s not be distracted.

  • If you expandDatabasesyou will see thepostgresdatabase.

  • You may or may not see databases calledtemplate0” andtemplate1”.

  • If you do see them, leave them alone.

  • Trust me

  • I once knew someone {Michael Harrison} who deleted these template databases on windows

  • and had to spend a fair amount of time cleaning up the registry and reinstalling the database

  • in order to return things to working order.

  • To create a database, right click onDatabasesand select createdatabase

  • We will create a database calledsocratica.”

  • The owner ispostgresthe superuser.

  • This is also the title of an upcoming action film.

  • Before we clicksave”, let us look at theSQLtab.

  • This shows the SQL command that will be executed in order to create this database.

  • Whenever you are making a change to a database using pgAdmin, I would suggest looking at

  • the SQL tab.

  • It will strengthen your understanding of SQL and provide you with useful code snippets

  • you can use in your scripts and code.

  • We return now to theGeneraltab andSave.”

  • Our database has been created.

  • To see how many tables there are, open theSchemasfolder.

  • By default, this database has a public schema.

  • Expanding the public schema reveals a long list of features you can use when building

  • your database.

  • The most essential are your tables.

  • And by clicking on this, you can see oursocraticadatabase currently has no tables.

  • And by the looks of it, there are no chairs, either

  • We will fix this in a future video.

  • Now that you have installed Postgres, you can tell everyone you meet that you

  • have installed Postgres.

  • But wait, it gets better.

  • You are no longer just a user - you are now a superuser.

  • The world of data is yours for the storing.

  • So crack those knuckles, grab that manual, and be sure to lift with your knees.

  • Because manual heavy.

  • Subscribe to Socratica for more excellent videos.

Hello viewer.

Subtitles and vocabulary

Click the word to look it up Click the word to find further inforamtion about it